getAdditionalProperties() {
private boolean equalTo(BillingPlanCreditGrantResponseData other) {
return autoTopupAmount.equals(other.autoTopupAmount)
&& autoTopupAmountType.equals(other.autoTopupAmountType)
+ && autoTopupAvailability.equals(other.autoTopupAvailability)
&& autoTopupEnabled == other.autoTopupEnabled
&& autoTopupExpiryType.equals(other.autoTopupExpiryType)
&& autoTopupExpiryUnit.equals(other.autoTopupExpiryUnit)
@@ -327,6 +355,7 @@ private boolean equalTo(BillingPlanCreditGrantResponseData other) {
&& autoTopupSelfService == other.autoTopupSelfService
&& autoTopupThresholdCredits.equals(other.autoTopupThresholdCredits)
&& autoTopupThresholdPercent.equals(other.autoTopupThresholdPercent)
+ && canBuyBundles == other.canBuyBundles
&& createdAt.equals(other.createdAt)
&& credit.equals(other.credit)
&& creditAmount == other.creditAmount
@@ -354,6 +383,7 @@ public int hashCode() {
return Objects.hash(
this.autoTopupAmount,
this.autoTopupAmountType,
+ this.autoTopupAvailability,
this.autoTopupEnabled,
this.autoTopupExpiryType,
this.autoTopupExpiryUnit,
@@ -361,6 +391,7 @@ public int hashCode() {
this.autoTopupSelfService,
this.autoTopupThresholdCredits,
this.autoTopupThresholdPercent,
+ this.canBuyBundles,
this.createdAt,
this.credit,
this.creditAmount,
@@ -388,18 +419,35 @@ public String toString() {
return ObjectMappers.stringify(this);
}
- public static AutoTopupEnabledStage builder() {
+ public static AutoTopupAvailabilityStage builder() {
return new Builder();
}
- public interface AutoTopupEnabledStage {
- AutoTopupSelfServiceStage autoTopupEnabled(boolean autoTopupEnabled);
+ public interface AutoTopupAvailabilityStage {
+ AutoTopupEnabledStage autoTopupAvailability(@NotNull BillingCreditAutoTopupAvailability autoTopupAvailability);
Builder from(BillingPlanCreditGrantResponseData other);
}
+ public interface AutoTopupEnabledStage {
+ /**
+ * Derived from auto_topup_availability; use that instead.
+ */
+ AutoTopupSelfServiceStage autoTopupEnabled(boolean autoTopupEnabled);
+ }
+
public interface AutoTopupSelfServiceStage {
- CreatedAtStage autoTopupSelfService(boolean autoTopupSelfService);
+ /**
+ * Derived from auto_topup_availability; use that instead.
+ */
+ CanBuyBundlesStage autoTopupSelfService(boolean autoTopupSelfService);
+ }
+
+ public interface CanBuyBundlesStage {
+ /**
+ * Whether buyers can purchase one-time credit bundles on this grant, independent of auto top-up availability.
+ */
+ CreatedAtStage canBuyBundles(boolean canBuyBundles);
}
public interface CreatedAtStage {
@@ -535,8 +583,10 @@ public interface _FinalStage {
@JsonIgnoreProperties(ignoreUnknown = true)
public static final class Builder
- implements AutoTopupEnabledStage,
+ implements AutoTopupAvailabilityStage,
+ AutoTopupEnabledStage,
AutoTopupSelfServiceStage,
+ CanBuyBundlesStage,
CreatedAtStage,
CreditAmountStage,
CreditIdStage,
@@ -547,10 +597,14 @@ public static final class Builder
RolloverPercentageStage,
UpdatedAtStage,
_FinalStage {
+ private BillingCreditAutoTopupAvailability autoTopupAvailability;
+
private boolean autoTopupEnabled;
private boolean autoTopupSelfService;
+ private boolean canBuyBundles;
+
private OffsetDateTime createdAt;
private long creditAmount;
@@ -614,6 +668,7 @@ private Builder() {}
public Builder from(BillingPlanCreditGrantResponseData other) {
autoTopupAmount(other.getAutoTopupAmount());
autoTopupAmountType(other.getAutoTopupAmountType());
+ autoTopupAvailability(other.getAutoTopupAvailability());
autoTopupEnabled(other.getAutoTopupEnabled());
autoTopupExpiryType(other.getAutoTopupExpiryType());
autoTopupExpiryUnit(other.getAutoTopupExpiryUnit());
@@ -621,6 +676,7 @@ public Builder from(BillingPlanCreditGrantResponseData other) {
autoTopupSelfService(other.getAutoTopupSelfService());
autoTopupThresholdCredits(other.getAutoTopupThresholdCredits());
autoTopupThresholdPercent(other.getAutoTopupThresholdPercent());
+ canBuyBundles(other.getCanBuyBundles());
createdAt(other.getCreatedAt());
credit(other.getCredit());
creditAmount(other.getCreditAmount());
@@ -644,6 +700,20 @@ public Builder from(BillingPlanCreditGrantResponseData other) {
return this;
}
+ @java.lang.Override
+ @JsonSetter("auto_topup_availability")
+ public AutoTopupEnabledStage autoTopupAvailability(
+ @NotNull BillingCreditAutoTopupAvailability autoTopupAvailability) {
+ this.autoTopupAvailability =
+ Objects.requireNonNull(autoTopupAvailability, "autoTopupAvailability must not be null");
+ return this;
+ }
+
+ /**
+ * Derived from auto_topup_availability; use that instead.
+ * Derived from auto_topup_availability; use that instead.
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
@java.lang.Override
@JsonSetter("auto_topup_enabled")
public AutoTopupSelfServiceStage autoTopupEnabled(boolean autoTopupEnabled) {
@@ -651,13 +721,30 @@ public AutoTopupSelfServiceStage autoTopupEnabled(boolean autoTopupEnabled) {
return this;
}
+ /**
+ * Derived from auto_topup_availability; use that instead.
+ * Derived from auto_topup_availability; use that instead.
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
@java.lang.Override
@JsonSetter("auto_topup_self_service")
- public CreatedAtStage autoTopupSelfService(boolean autoTopupSelfService) {
+ public CanBuyBundlesStage autoTopupSelfService(boolean autoTopupSelfService) {
this.autoTopupSelfService = autoTopupSelfService;
return this;
}
+ /**
+ * Whether buyers can purchase one-time credit bundles on this grant, independent of auto top-up availability.
+ * Whether buyers can purchase one-time credit bundles on this grant, independent of auto top-up availability.
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ @JsonSetter("can_buy_bundles")
+ public CreatedAtStage canBuyBundles(boolean canBuyBundles) {
+ this.canBuyBundles = canBuyBundles;
+ return this;
+ }
+
@java.lang.Override
@JsonSetter("created_at")
public CreditAmountStage createdAt(@NotNull OffsetDateTime createdAt) {
@@ -989,6 +1076,7 @@ public BillingPlanCreditGrantResponseData build() {
return new BillingPlanCreditGrantResponseData(
autoTopupAmount,
autoTopupAmountType,
+ autoTopupAvailability,
autoTopupEnabled,
autoTopupExpiryType,
autoTopupExpiryUnit,
@@ -996,6 +1084,7 @@ public BillingPlanCreditGrantResponseData build() {
autoTopupSelfService,
autoTopupThresholdCredits,
autoTopupThresholdPercent,
+ canBuyBundles,
createdAt,
credit,
creditAmount,
diff --git a/src/main/java/com/schematic/api/types/ChangeSubscriptionInternalRequestBody.java b/src/main/java/com/schematic/api/types/ChangeSubscriptionInternalRequestBody.java
index 6ef605eb..b8eec751 100644
--- a/src/main/java/com/schematic/api/types/ChangeSubscriptionInternalRequestBody.java
+++ b/src/main/java/com/schematic/api/types/ChangeSubscriptionInternalRequestBody.java
@@ -27,6 +27,8 @@ public final class ChangeSubscriptionInternalRequestBody {
private final List autoTopupOverrides;
+ private final Optional billingEntityId;
+
private final String companyId;
private final Optional couponExternalId;
@@ -54,6 +56,7 @@ public final class ChangeSubscriptionInternalRequestBody {
private ChangeSubscriptionInternalRequestBody(
List addOnIds,
List autoTopupOverrides,
+ Optional billingEntityId,
String companyId,
Optional couponExternalId,
List creditBundles,
@@ -68,6 +71,7 @@ private ChangeSubscriptionInternalRequestBody(
Map additionalProperties) {
this.addOnIds = addOnIds;
this.autoTopupOverrides = autoTopupOverrides;
+ this.billingEntityId = billingEntityId;
this.companyId = companyId;
this.couponExternalId = couponExternalId;
this.creditBundles = creditBundles;
@@ -92,6 +96,11 @@ public List getAutoTopupOverrides() {
return autoTopupOverrides;
}
+ @JsonProperty("billing_entity_id")
+ public Optional getBillingEntityId() {
+ return billingEntityId;
+ }
+
@JsonProperty("company_id")
public String getCompanyId() {
return companyId;
@@ -162,6 +171,7 @@ public Map getAdditionalProperties() {
private boolean equalTo(ChangeSubscriptionInternalRequestBody other) {
return addOnIds.equals(other.addOnIds)
&& autoTopupOverrides.equals(other.autoTopupOverrides)
+ && billingEntityId.equals(other.billingEntityId)
&& companyId.equals(other.companyId)
&& couponExternalId.equals(other.couponExternalId)
&& creditBundles.equals(other.creditBundles)
@@ -180,6 +190,7 @@ public int hashCode() {
return Objects.hash(
this.addOnIds,
this.autoTopupOverrides,
+ this.billingEntityId,
this.companyId,
this.couponExternalId,
this.creditBundles,
@@ -239,6 +250,10 @@ public interface _FinalStage {
_FinalStage addAllAutoTopupOverrides(List autoTopupOverrides);
+ _FinalStage billingEntityId(Optional billingEntityId);
+
+ _FinalStage billingEntityId(String billingEntityId);
+
_FinalStage couponExternalId(Optional couponExternalId);
_FinalStage couponExternalId(String couponExternalId);
@@ -299,6 +314,8 @@ public static final class Builder
private Optional couponExternalId = Optional.empty();
+ private Optional billingEntityId = Optional.empty();
+
private List autoTopupOverrides = new ArrayList<>();
private List addOnIds = new ArrayList<>();
@@ -312,6 +329,7 @@ private Builder() {}
public Builder from(ChangeSubscriptionInternalRequestBody other) {
addOnIds(other.getAddOnIds());
autoTopupOverrides(other.getAutoTopupOverrides());
+ billingEntityId(other.getBillingEntityId());
companyId(other.getCompanyId());
couponExternalId(other.getCouponExternalId());
creditBundles(other.getCreditBundles());
@@ -478,6 +496,19 @@ public _FinalStage couponExternalId(Optional couponExternalId) {
return this;
}
+ @java.lang.Override
+ public _FinalStage billingEntityId(String billingEntityId) {
+ this.billingEntityId = Optional.ofNullable(billingEntityId);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "billing_entity_id", nulls = Nulls.SKIP)
+ public _FinalStage billingEntityId(Optional billingEntityId) {
+ this.billingEntityId = billingEntityId;
+ return this;
+ }
+
@java.lang.Override
public _FinalStage addAllAutoTopupOverrides(List autoTopupOverrides) {
if (autoTopupOverrides != null) {
@@ -531,6 +562,7 @@ public ChangeSubscriptionInternalRequestBody build() {
return new ChangeSubscriptionInternalRequestBody(
addOnIds,
autoTopupOverrides,
+ billingEntityId,
companyId,
couponExternalId,
creditBundles,
diff --git a/src/main/java/com/schematic/api/types/ChangeSubscriptionRequestBody.java b/src/main/java/com/schematic/api/types/ChangeSubscriptionRequestBody.java
index 6cc9c729..3c43cd68 100644
--- a/src/main/java/com/schematic/api/types/ChangeSubscriptionRequestBody.java
+++ b/src/main/java/com/schematic/api/types/ChangeSubscriptionRequestBody.java
@@ -27,6 +27,8 @@ public final class ChangeSubscriptionRequestBody {
private final List autoTopupOverrides;
+ private final Optional billingEntityId;
+
private final Optional couponExternalId;
private final List creditBundles;
@@ -52,6 +54,7 @@ public final class ChangeSubscriptionRequestBody {
private ChangeSubscriptionRequestBody(
List addOnIds,
List autoTopupOverrides,
+ Optional billingEntityId,
Optional couponExternalId,
List creditBundles,
List customFieldValues,
@@ -65,6 +68,7 @@ private ChangeSubscriptionRequestBody(
Map additionalProperties) {
this.addOnIds = addOnIds;
this.autoTopupOverrides = autoTopupOverrides;
+ this.billingEntityId = billingEntityId;
this.couponExternalId = couponExternalId;
this.creditBundles = creditBundles;
this.customFieldValues = customFieldValues;
@@ -88,6 +92,11 @@ public List getAutoTopupOverrides() {
return autoTopupOverrides;
}
+ @JsonProperty("billing_entity_id")
+ public Optional getBillingEntityId() {
+ return billingEntityId;
+ }
+
@JsonProperty("coupon_external_id")
public Optional getCouponExternalId() {
return couponExternalId;
@@ -152,6 +161,7 @@ public Map getAdditionalProperties() {
private boolean equalTo(ChangeSubscriptionRequestBody other) {
return addOnIds.equals(other.addOnIds)
&& autoTopupOverrides.equals(other.autoTopupOverrides)
+ && billingEntityId.equals(other.billingEntityId)
&& couponExternalId.equals(other.couponExternalId)
&& creditBundles.equals(other.creditBundles)
&& customFieldValues.equals(other.customFieldValues)
@@ -169,6 +179,7 @@ public int hashCode() {
return Objects.hash(
this.addOnIds,
this.autoTopupOverrides,
+ this.billingEntityId,
this.couponExternalId,
this.creditBundles,
this.customFieldValues,
@@ -223,6 +234,10 @@ public interface _FinalStage {
_FinalStage addAllAutoTopupOverrides(List autoTopupOverrides);
+ _FinalStage billingEntityId(Optional billingEntityId);
+
+ _FinalStage billingEntityId(String billingEntityId);
+
_FinalStage couponExternalId(Optional couponExternalId);
_FinalStage couponExternalId(String couponExternalId);
@@ -280,6 +295,8 @@ public static final class Builder implements NewPlanIdStage, NewPriceIdStage, Sk
private Optional couponExternalId = Optional.empty();
+ private Optional billingEntityId = Optional.empty();
+
private List autoTopupOverrides = new ArrayList<>();
private List addOnIds = new ArrayList<>();
@@ -293,6 +310,7 @@ private Builder() {}
public Builder from(ChangeSubscriptionRequestBody other) {
addOnIds(other.getAddOnIds());
autoTopupOverrides(other.getAutoTopupOverrides());
+ billingEntityId(other.getBillingEntityId());
couponExternalId(other.getCouponExternalId());
creditBundles(other.getCreditBundles());
customFieldValues(other.getCustomFieldValues());
@@ -451,6 +469,19 @@ public _FinalStage couponExternalId(Optional couponExternalId) {
return this;
}
+ @java.lang.Override
+ public _FinalStage billingEntityId(String billingEntityId) {
+ this.billingEntityId = Optional.ofNullable(billingEntityId);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "billing_entity_id", nulls = Nulls.SKIP)
+ public _FinalStage billingEntityId(Optional billingEntityId) {
+ this.billingEntityId = billingEntityId;
+ return this;
+ }
+
@java.lang.Override
public _FinalStage addAllAutoTopupOverrides(List autoTopupOverrides) {
if (autoTopupOverrides != null) {
@@ -504,6 +535,7 @@ public ChangeSubscriptionRequestBody build() {
return new ChangeSubscriptionRequestBody(
addOnIds,
autoTopupOverrides,
+ billingEntityId,
couponExternalId,
creditBundles,
customFieldValues,
diff --git a/src/main/java/com/schematic/api/types/CompanyBillingEntityResponseData.java b/src/main/java/com/schematic/api/types/CompanyBillingEntityResponseData.java
new file mode 100644
index 00000000..d8e5eb7c
--- /dev/null
+++ b/src/main/java/com/schematic/api/types/CompanyBillingEntityResponseData.java
@@ -0,0 +1,150 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.schematic.api.types;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonSetter;
+import com.fasterxml.jackson.annotation.Nulls;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.schematic.api.core.ObjectMappers;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = CompanyBillingEntityResponseData.Builder.class)
+public final class CompanyBillingEntityResponseData {
+ private final Optional billingEntity;
+
+ private final boolean hasOwnStripeCustomer;
+
+ private final Map additionalProperties;
+
+ private CompanyBillingEntityResponseData(
+ Optional billingEntity,
+ boolean hasOwnStripeCustomer,
+ Map additionalProperties) {
+ this.billingEntity = billingEntity;
+ this.hasOwnStripeCustomer = hasOwnStripeCustomer;
+ this.additionalProperties = additionalProperties;
+ }
+
+ @JsonProperty("billing_entity")
+ public Optional getBillingEntity() {
+ return billingEntity;
+ }
+
+ @JsonProperty("has_own_stripe_customer")
+ public boolean getHasOwnStripeCustomer() {
+ return hasOwnStripeCustomer;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof CompanyBillingEntityResponseData && equalTo((CompanyBillingEntityResponseData) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(CompanyBillingEntityResponseData other) {
+ return billingEntity.equals(other.billingEntity) && hasOwnStripeCustomer == other.hasOwnStripeCustomer;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.billingEntity, this.hasOwnStripeCustomer);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static HasOwnStripeCustomerStage builder() {
+ return new Builder();
+ }
+
+ public interface HasOwnStripeCustomerStage {
+ _FinalStage hasOwnStripeCustomer(boolean hasOwnStripeCustomer);
+
+ Builder from(CompanyBillingEntityResponseData other);
+ }
+
+ public interface _FinalStage {
+ CompanyBillingEntityResponseData build();
+
+ _FinalStage additionalProperty(String key, Object value);
+
+ _FinalStage additionalProperties(Map additionalProperties);
+
+ _FinalStage billingEntity(Optional billingEntity);
+
+ _FinalStage billingEntity(CompanyResponseData billingEntity);
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder implements HasOwnStripeCustomerStage, _FinalStage {
+ private boolean hasOwnStripeCustomer;
+
+ private Optional billingEntity = Optional.empty();
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ @java.lang.Override
+ public Builder from(CompanyBillingEntityResponseData other) {
+ billingEntity(other.getBillingEntity());
+ hasOwnStripeCustomer(other.getHasOwnStripeCustomer());
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("has_own_stripe_customer")
+ public _FinalStage hasOwnStripeCustomer(boolean hasOwnStripeCustomer) {
+ this.hasOwnStripeCustomer = hasOwnStripeCustomer;
+ return this;
+ }
+
+ @java.lang.Override
+ public _FinalStage billingEntity(CompanyResponseData billingEntity) {
+ this.billingEntity = Optional.ofNullable(billingEntity);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "billing_entity", nulls = Nulls.SKIP)
+ public _FinalStage billingEntity(Optional billingEntity) {
+ this.billingEntity = billingEntity;
+ return this;
+ }
+
+ @java.lang.Override
+ public CompanyBillingEntityResponseData build() {
+ return new CompanyBillingEntityResponseData(billingEntity, hasOwnStripeCustomer, additionalProperties);
+ }
+
+ @java.lang.Override
+ public Builder additionalProperty(String key, Object value) {
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ @java.lang.Override
+ public Builder additionalProperties(Map additionalProperties) {
+ this.additionalProperties.putAll(additionalProperties);
+ return this;
+ }
+ }
+}
diff --git a/src/main/java/com/schematic/api/types/CompanyBillingEntitySubscriptionResponseData.java b/src/main/java/com/schematic/api/types/CompanyBillingEntitySubscriptionResponseData.java
new file mode 100644
index 00000000..59d2f48e
--- /dev/null
+++ b/src/main/java/com/schematic/api/types/CompanyBillingEntitySubscriptionResponseData.java
@@ -0,0 +1,657 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.schematic.api.types;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonSetter;
+import com.fasterxml.jackson.annotation.Nulls;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.schematic.api.core.ObjectMappers;
+import java.time.OffsetDateTime;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import org.jetbrains.annotations.NotNull;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = CompanyBillingEntitySubscriptionResponseData.Builder.class)
+public final class CompanyBillingEntitySubscriptionResponseData {
+ private final Optional cancelAt;
+
+ private final boolean cancelAtPeriodEnd;
+
+ private final Optional company;
+
+ private final String currency;
+
+ private final String customerExternalId;
+
+ private final List discounts;
+
+ private final Optional expiredAt;
+
+ private final String interval;
+
+ private final boolean isInitial;
+
+ private final Optional latestInvoice;
+
+ private final Optional paymentMethod;
+
+ private final String planName;
+
+ private final List products;
+
+ private final BillingProviderType providerType;
+
+ private final String status;
+
+ private final String subscriptionExternalId;
+
+ private final long totalPrice;
+
+ private final Optional trialEnd;
+
+ private final Map additionalProperties;
+
+ private CompanyBillingEntitySubscriptionResponseData(
+ Optional cancelAt,
+ boolean cancelAtPeriodEnd,
+ Optional company,
+ String currency,
+ String customerExternalId,
+ List discounts,
+ Optional expiredAt,
+ String interval,
+ boolean isInitial,
+ Optional latestInvoice,
+ Optional paymentMethod,
+ String planName,
+ List products,
+ BillingProviderType providerType,
+ String status,
+ String subscriptionExternalId,
+ long totalPrice,
+ Optional trialEnd,
+ Map additionalProperties) {
+ this.cancelAt = cancelAt;
+ this.cancelAtPeriodEnd = cancelAtPeriodEnd;
+ this.company = company;
+ this.currency = currency;
+ this.customerExternalId = customerExternalId;
+ this.discounts = discounts;
+ this.expiredAt = expiredAt;
+ this.interval = interval;
+ this.isInitial = isInitial;
+ this.latestInvoice = latestInvoice;
+ this.paymentMethod = paymentMethod;
+ this.planName = planName;
+ this.products = products;
+ this.providerType = providerType;
+ this.status = status;
+ this.subscriptionExternalId = subscriptionExternalId;
+ this.totalPrice = totalPrice;
+ this.trialEnd = trialEnd;
+ this.additionalProperties = additionalProperties;
+ }
+
+ @JsonProperty("cancel_at")
+ public Optional getCancelAt() {
+ return cancelAt;
+ }
+
+ @JsonProperty("cancel_at_period_end")
+ public boolean getCancelAtPeriodEnd() {
+ return cancelAtPeriodEnd;
+ }
+
+ @JsonProperty("company")
+ public Optional getCompany() {
+ return company;
+ }
+
+ @JsonProperty("currency")
+ public String getCurrency() {
+ return currency;
+ }
+
+ @JsonProperty("customer_external_id")
+ public String getCustomerExternalId() {
+ return customerExternalId;
+ }
+
+ @JsonProperty("discounts")
+ public List getDiscounts() {
+ return discounts;
+ }
+
+ @JsonProperty("expired_at")
+ public Optional getExpiredAt() {
+ return expiredAt;
+ }
+
+ @JsonProperty("interval")
+ public String getInterval() {
+ return interval;
+ }
+
+ @JsonProperty("is_initial")
+ public boolean getIsInitial() {
+ return isInitial;
+ }
+
+ @JsonProperty("latest_invoice")
+ public Optional getLatestInvoice() {
+ return latestInvoice;
+ }
+
+ @JsonProperty("payment_method")
+ public Optional getPaymentMethod() {
+ return paymentMethod;
+ }
+
+ @JsonProperty("plan_name")
+ public String getPlanName() {
+ return planName;
+ }
+
+ @JsonProperty("products")
+ public List getProducts() {
+ return products;
+ }
+
+ @JsonProperty("provider_type")
+ public BillingProviderType getProviderType() {
+ return providerType;
+ }
+
+ @JsonProperty("status")
+ public String getStatus() {
+ return status;
+ }
+
+ @JsonProperty("subscription_external_id")
+ public String getSubscriptionExternalId() {
+ return subscriptionExternalId;
+ }
+
+ @JsonProperty("total_price")
+ public long getTotalPrice() {
+ return totalPrice;
+ }
+
+ @JsonProperty("trial_end")
+ public Optional getTrialEnd() {
+ return trialEnd;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof CompanyBillingEntitySubscriptionResponseData
+ && equalTo((CompanyBillingEntitySubscriptionResponseData) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(CompanyBillingEntitySubscriptionResponseData other) {
+ return cancelAt.equals(other.cancelAt)
+ && cancelAtPeriodEnd == other.cancelAtPeriodEnd
+ && company.equals(other.company)
+ && currency.equals(other.currency)
+ && customerExternalId.equals(other.customerExternalId)
+ && discounts.equals(other.discounts)
+ && expiredAt.equals(other.expiredAt)
+ && interval.equals(other.interval)
+ && isInitial == other.isInitial
+ && latestInvoice.equals(other.latestInvoice)
+ && paymentMethod.equals(other.paymentMethod)
+ && planName.equals(other.planName)
+ && products.equals(other.products)
+ && providerType.equals(other.providerType)
+ && status.equals(other.status)
+ && subscriptionExternalId.equals(other.subscriptionExternalId)
+ && totalPrice == other.totalPrice
+ && trialEnd.equals(other.trialEnd);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(
+ this.cancelAt,
+ this.cancelAtPeriodEnd,
+ this.company,
+ this.currency,
+ this.customerExternalId,
+ this.discounts,
+ this.expiredAt,
+ this.interval,
+ this.isInitial,
+ this.latestInvoice,
+ this.paymentMethod,
+ this.planName,
+ this.products,
+ this.providerType,
+ this.status,
+ this.subscriptionExternalId,
+ this.totalPrice,
+ this.trialEnd);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static CancelAtPeriodEndStage builder() {
+ return new Builder();
+ }
+
+ public interface CancelAtPeriodEndStage {
+ CurrencyStage cancelAtPeriodEnd(boolean cancelAtPeriodEnd);
+
+ Builder from(CompanyBillingEntitySubscriptionResponseData other);
+ }
+
+ public interface CurrencyStage {
+ CustomerExternalIdStage currency(@NotNull String currency);
+ }
+
+ public interface CustomerExternalIdStage {
+ IntervalStage customerExternalId(@NotNull String customerExternalId);
+ }
+
+ public interface IntervalStage {
+ IsInitialStage interval(@NotNull String interval);
+ }
+
+ public interface IsInitialStage {
+ PlanNameStage isInitial(boolean isInitial);
+ }
+
+ public interface PlanNameStage {
+ ProviderTypeStage planName(@NotNull String planName);
+ }
+
+ public interface ProviderTypeStage {
+ StatusStage providerType(@NotNull BillingProviderType providerType);
+ }
+
+ public interface StatusStage {
+ SubscriptionExternalIdStage status(@NotNull String status);
+ }
+
+ public interface SubscriptionExternalIdStage {
+ TotalPriceStage subscriptionExternalId(@NotNull String subscriptionExternalId);
+ }
+
+ public interface TotalPriceStage {
+ _FinalStage totalPrice(long totalPrice);
+ }
+
+ public interface _FinalStage {
+ CompanyBillingEntitySubscriptionResponseData build();
+
+ _FinalStage additionalProperty(String key, Object value);
+
+ _FinalStage additionalProperties(Map additionalProperties);
+
+ _FinalStage cancelAt(Optional cancelAt);
+
+ _FinalStage cancelAt(OffsetDateTime cancelAt);
+
+ _FinalStage company(Optional company);
+
+ _FinalStage company(CompanyResponseData company);
+
+ _FinalStage discounts(List discounts);
+
+ _FinalStage addDiscounts(BillingSubscriptionDiscountView discounts);
+
+ _FinalStage addAllDiscounts(List discounts);
+
+ _FinalStage expiredAt(Optional expiredAt);
+
+ _FinalStage expiredAt(OffsetDateTime expiredAt);
+
+ _FinalStage latestInvoice(Optional latestInvoice);
+
+ _FinalStage latestInvoice(InvoiceResponseData latestInvoice);
+
+ _FinalStage paymentMethod(Optional paymentMethod);
+
+ _FinalStage paymentMethod(PaymentMethodResponseData paymentMethod);
+
+ _FinalStage products(List products);
+
+ _FinalStage addProducts(BillingProductForSubscriptionResponseData products);
+
+ _FinalStage addAllProducts(List products);
+
+ _FinalStage trialEnd(Optional trialEnd);
+
+ _FinalStage trialEnd(OffsetDateTime trialEnd);
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder
+ implements CancelAtPeriodEndStage,
+ CurrencyStage,
+ CustomerExternalIdStage,
+ IntervalStage,
+ IsInitialStage,
+ PlanNameStage,
+ ProviderTypeStage,
+ StatusStage,
+ SubscriptionExternalIdStage,
+ TotalPriceStage,
+ _FinalStage {
+ private boolean cancelAtPeriodEnd;
+
+ private String currency;
+
+ private String customerExternalId;
+
+ private String interval;
+
+ private boolean isInitial;
+
+ private String planName;
+
+ private BillingProviderType providerType;
+
+ private String status;
+
+ private String subscriptionExternalId;
+
+ private long totalPrice;
+
+ private Optional trialEnd = Optional.empty();
+
+ private List products = new ArrayList<>();
+
+ private Optional paymentMethod = Optional.empty();
+
+ private Optional latestInvoice = Optional.empty();
+
+ private Optional expiredAt = Optional.empty();
+
+ private List discounts = new ArrayList<>();
+
+ private Optional company = Optional.empty();
+
+ private Optional cancelAt = Optional.empty();
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ @java.lang.Override
+ public Builder from(CompanyBillingEntitySubscriptionResponseData other) {
+ cancelAt(other.getCancelAt());
+ cancelAtPeriodEnd(other.getCancelAtPeriodEnd());
+ company(other.getCompany());
+ currency(other.getCurrency());
+ customerExternalId(other.getCustomerExternalId());
+ discounts(other.getDiscounts());
+ expiredAt(other.getExpiredAt());
+ interval(other.getInterval());
+ isInitial(other.getIsInitial());
+ latestInvoice(other.getLatestInvoice());
+ paymentMethod(other.getPaymentMethod());
+ planName(other.getPlanName());
+ products(other.getProducts());
+ providerType(other.getProviderType());
+ status(other.getStatus());
+ subscriptionExternalId(other.getSubscriptionExternalId());
+ totalPrice(other.getTotalPrice());
+ trialEnd(other.getTrialEnd());
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("cancel_at_period_end")
+ public CurrencyStage cancelAtPeriodEnd(boolean cancelAtPeriodEnd) {
+ this.cancelAtPeriodEnd = cancelAtPeriodEnd;
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("currency")
+ public CustomerExternalIdStage currency(@NotNull String currency) {
+ this.currency = Objects.requireNonNull(currency, "currency must not be null");
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("customer_external_id")
+ public IntervalStage customerExternalId(@NotNull String customerExternalId) {
+ this.customerExternalId = Objects.requireNonNull(customerExternalId, "customerExternalId must not be null");
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("interval")
+ public IsInitialStage interval(@NotNull String interval) {
+ this.interval = Objects.requireNonNull(interval, "interval must not be null");
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("is_initial")
+ public PlanNameStage isInitial(boolean isInitial) {
+ this.isInitial = isInitial;
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("plan_name")
+ public ProviderTypeStage planName(@NotNull String planName) {
+ this.planName = Objects.requireNonNull(planName, "planName must not be null");
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("provider_type")
+ public StatusStage providerType(@NotNull BillingProviderType providerType) {
+ this.providerType = Objects.requireNonNull(providerType, "providerType must not be null");
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("status")
+ public SubscriptionExternalIdStage status(@NotNull String status) {
+ this.status = Objects.requireNonNull(status, "status must not be null");
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("subscription_external_id")
+ public TotalPriceStage subscriptionExternalId(@NotNull String subscriptionExternalId) {
+ this.subscriptionExternalId =
+ Objects.requireNonNull(subscriptionExternalId, "subscriptionExternalId must not be null");
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("total_price")
+ public _FinalStage totalPrice(long totalPrice) {
+ this.totalPrice = totalPrice;
+ return this;
+ }
+
+ @java.lang.Override
+ public _FinalStage trialEnd(OffsetDateTime trialEnd) {
+ this.trialEnd = Optional.ofNullable(trialEnd);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "trial_end", nulls = Nulls.SKIP)
+ public _FinalStage trialEnd(Optional trialEnd) {
+ this.trialEnd = trialEnd;
+ return this;
+ }
+
+ @java.lang.Override
+ public _FinalStage addAllProducts(List products) {
+ if (products != null) {
+ this.products.addAll(products);
+ }
+ return this;
+ }
+
+ @java.lang.Override
+ public _FinalStage addProducts(BillingProductForSubscriptionResponseData products) {
+ this.products.add(products);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "products", nulls = Nulls.SKIP)
+ public _FinalStage products(List products) {
+ this.products.clear();
+ if (products != null) {
+ this.products.addAll(products);
+ }
+ return this;
+ }
+
+ @java.lang.Override
+ public _FinalStage paymentMethod(PaymentMethodResponseData paymentMethod) {
+ this.paymentMethod = Optional.ofNullable(paymentMethod);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "payment_method", nulls = Nulls.SKIP)
+ public _FinalStage paymentMethod(Optional paymentMethod) {
+ this.paymentMethod = paymentMethod;
+ return this;
+ }
+
+ @java.lang.Override
+ public _FinalStage latestInvoice(InvoiceResponseData latestInvoice) {
+ this.latestInvoice = Optional.ofNullable(latestInvoice);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "latest_invoice", nulls = Nulls.SKIP)
+ public _FinalStage latestInvoice(Optional latestInvoice) {
+ this.latestInvoice = latestInvoice;
+ return this;
+ }
+
+ @java.lang.Override
+ public _FinalStage expiredAt(OffsetDateTime expiredAt) {
+ this.expiredAt = Optional.ofNullable(expiredAt);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "expired_at", nulls = Nulls.SKIP)
+ public _FinalStage expiredAt(Optional expiredAt) {
+ this.expiredAt = expiredAt;
+ return this;
+ }
+
+ @java.lang.Override
+ public _FinalStage addAllDiscounts(List discounts) {
+ if (discounts != null) {
+ this.discounts.addAll(discounts);
+ }
+ return this;
+ }
+
+ @java.lang.Override
+ public _FinalStage addDiscounts(BillingSubscriptionDiscountView discounts) {
+ this.discounts.add(discounts);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "discounts", nulls = Nulls.SKIP)
+ public _FinalStage discounts(List discounts) {
+ this.discounts.clear();
+ if (discounts != null) {
+ this.discounts.addAll(discounts);
+ }
+ return this;
+ }
+
+ @java.lang.Override
+ public _FinalStage company(CompanyResponseData company) {
+ this.company = Optional.ofNullable(company);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "company", nulls = Nulls.SKIP)
+ public _FinalStage company(Optional company) {
+ this.company = company;
+ return this;
+ }
+
+ @java.lang.Override
+ public _FinalStage cancelAt(OffsetDateTime cancelAt) {
+ this.cancelAt = Optional.ofNullable(cancelAt);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "cancel_at", nulls = Nulls.SKIP)
+ public _FinalStage cancelAt(Optional cancelAt) {
+ this.cancelAt = cancelAt;
+ return this;
+ }
+
+ @java.lang.Override
+ public CompanyBillingEntitySubscriptionResponseData build() {
+ return new CompanyBillingEntitySubscriptionResponseData(
+ cancelAt,
+ cancelAtPeriodEnd,
+ company,
+ currency,
+ customerExternalId,
+ discounts,
+ expiredAt,
+ interval,
+ isInitial,
+ latestInvoice,
+ paymentMethod,
+ planName,
+ products,
+ providerType,
+ status,
+ subscriptionExternalId,
+ totalPrice,
+ trialEnd,
+ additionalProperties);
+ }
+
+ @java.lang.Override
+ public Builder additionalProperty(String key, Object value) {
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ @java.lang.Override
+ public Builder additionalProperties(Map additionalProperties) {
+ this.additionalProperties.putAll(additionalProperties);
+ return this;
+ }
+ }
+}
diff --git a/src/main/java/com/schematic/api/types/CompanyPlanCreditGrantView.java b/src/main/java/com/schematic/api/types/CompanyPlanCreditGrantView.java
index 5324b63d..6ccf3a6b 100644
--- a/src/main/java/com/schematic/api/types/CompanyPlanCreditGrantView.java
+++ b/src/main/java/com/schematic/api/types/CompanyPlanCreditGrantView.java
@@ -26,6 +26,8 @@ public final class CompanyPlanCreditGrantView {
private final Optional billingCreditAutoTopupAmountType;
+ private final Optional billingCreditAutoTopupAvailability;
+
private final boolean billingCreditAutoTopupEnabled;
private final Optional billingCreditAutoTopupExpiryType;
@@ -40,6 +42,8 @@ public final class CompanyPlanCreditGrantView {
private final Optional billingCreditAutoTopupThresholdPercent;
+ private final boolean billingCreditCanBuyBundles;
+
private final Optional companyAutoTopupAmount;
private final Optional