Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.6.0
4.7.0
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = "com.chargebee"
version = "4.6.0"
version = "4.7.0"
description = "Java client library for ChargeBee"

// Project metadata
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/com/chargebee/v4/client/ClientMethods.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@

import com.chargebee.v4.services.UsageSummaryService;

import com.chargebee.v4.services.AlertStatusService;

import com.chargebee.v4.services.SubscriptionSettingService;

import com.chargebee.v4.services.SiteMigrationDetailService;
Expand Down Expand Up @@ -110,6 +112,8 @@

import com.chargebee.v4.services.UnbilledChargesSettingService;

import com.chargebee.v4.services.AlertService;

import com.chargebee.v4.services.CurrencyService;

import com.chargebee.v4.services.EventService;
Expand Down Expand Up @@ -389,6 +393,13 @@ public interface ClientMethods {
*/
UsageSummaryService usageSummaries();

/**
* Access alert_status-related operations.
*
* @return AlertStatusService instance for fluent API access
*/
AlertStatusService alertStatuses();

/**
* Access subscription_setting-related operations.
*
Expand Down Expand Up @@ -557,6 +568,13 @@ public interface ClientMethods {
*/
UnbilledChargesSettingService unbilledChargesSettings();

/**
* Access alert-related operations.
*
* @return AlertService instance for fluent API access
*/
AlertService alerts();

/**
* Access currency-related operations.
*
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/com/chargebee/v4/client/ClientMethodsImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@

import com.chargebee.v4.services.UsageSummaryService;

import com.chargebee.v4.services.AlertStatusService;

import com.chargebee.v4.services.SubscriptionSettingService;

import com.chargebee.v4.services.SiteMigrationDetailService;
Expand Down Expand Up @@ -110,6 +112,8 @@

import com.chargebee.v4.services.UnbilledChargesSettingService;

import com.chargebee.v4.services.AlertService;

import com.chargebee.v4.services.CurrencyService;

import com.chargebee.v4.services.EventService;
Expand Down Expand Up @@ -329,6 +333,11 @@ public UsageSummaryService usageSummaries() {
return getServiceRegistry().usageSummaries();
}

@Override
public AlertStatusService alertStatuses() {
return getServiceRegistry().alertStatuses();
}

@Override
public SubscriptionSettingService subscriptionSettings() {
return getServiceRegistry().subscriptionSettings();
Expand Down Expand Up @@ -449,6 +458,11 @@ public UnbilledChargesSettingService unbilledChargesSettings() {
return getServiceRegistry().unbilledChargesSettings();
}

@Override
public AlertService alerts() {
return getServiceRegistry().alerts();
}

@Override
public CurrencyService currencies() {
return getServiceRegistry().currencies();
Expand Down
38 changes: 38 additions & 0 deletions src/main/java/com/chargebee/v4/client/ServiceRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@

import com.chargebee.v4.services.UsageSummaryService;

import com.chargebee.v4.services.AlertStatusService;

import com.chargebee.v4.services.SubscriptionSettingService;

import com.chargebee.v4.services.SiteMigrationDetailService;
Expand Down Expand Up @@ -110,6 +112,8 @@

import com.chargebee.v4.services.UnbilledChargesSettingService;

import com.chargebee.v4.services.AlertService;

import com.chargebee.v4.services.CurrencyService;

import com.chargebee.v4.services.EventService;
Expand Down Expand Up @@ -235,6 +239,8 @@ final class ServiceRegistry {

private volatile UsageSummaryService usageSummaryService;

private volatile AlertStatusService alertStatusService;

private volatile SubscriptionSettingService subscriptionSettingService;

private volatile SiteMigrationDetailService siteMigrationDetailService;
Expand Down Expand Up @@ -283,6 +289,8 @@ final class ServiceRegistry {

private volatile UnbilledChargesSettingService unbilledChargesSettingService;

private volatile AlertService alertService;

private volatile CurrencyService currencyService;

private volatile EventService eventService;
Expand Down Expand Up @@ -808,6 +816,21 @@ UsageSummaryService usageSummaries() {
return usageSummaryService;
}

/**
* Get or create the AlertStatusService instance. Thread-safe lazy initialization using
* double-checked locking.
*/
AlertStatusService alertStatuses() {
if (alertStatusService == null) {
synchronized (this) {
if (alertStatusService == null) {
alertStatusService = new AlertStatusService(client);
}
}
}
return alertStatusService;
}

/**
* Get or create the SubscriptionSettingService instance. Thread-safe lazy initialization using
* double-checked locking.
Expand Down Expand Up @@ -1168,6 +1191,21 @@ UnbilledChargesSettingService unbilledChargesSettings() {
return unbilledChargesSettingService;
}

/**
* Get or create the AlertService instance. Thread-safe lazy initialization using double-checked
* locking.
*/
AlertService alerts() {
if (alertService == null) {
synchronized (this) {
if (alertService == null) {
alertService = new AlertService(client);
}
}
}
return alertService;
}

/**
* Get or create the CurrencyService instance. Thread-safe lazy initialization using
* double-checked locking.
Expand Down
50 changes: 0 additions & 50 deletions src/main/java/com/chargebee/v4/models/alert/Alert.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public class Alert {
private String meteredFeatureId;
private String subscriptionId;
private Status status;
private Timestamp alarmTriggeredAt;
private Scope scope;
private String meta;
private Timestamp createdAt;
private Timestamp updatedAt;
Expand Down Expand Up @@ -54,14 +52,6 @@ public Status getStatus() {
return status;
}

public Timestamp getAlarmTriggeredAt() {
return alarmTriggeredAt;
}

public Scope getScope() {
return scope;
}

public String getMeta() {
return meta;
}
Expand Down Expand Up @@ -128,34 +118,6 @@ public static Status fromString(String value) {
}
}

public enum Scope {
GLOBAL("global"),

SUBSCRIPTION("subscription"),

/** An enum member indicating that Scope was instantiated with an unknown value. */
_UNKNOWN(null);
private final String value;

Scope(String value) {
this.value = value;
}

public String getValue() {
return value;
}

public static Scope fromString(String value) {
if (value == null) return _UNKNOWN;
for (Scope enumValue : Scope.values()) {
if (enumValue.value != null && enumValue.value.equals(value)) {
return enumValue;
}
}
return _UNKNOWN;
}
}

public static Alert fromJson(String json) {
return fromJson(JsonUtil.parse(json));
}
Expand All @@ -177,10 +139,6 @@ public static Alert fromJson(JsonObject jsonObj) {

obj.status = Status.fromString(JsonUtil.getString(jsonObj, "status"));

obj.alarmTriggeredAt = JsonUtil.getTimestamp(jsonObj, "alarm_triggered_at");

obj.scope = Scope.fromString(JsonUtil.getString(jsonObj, "scope"));

obj.meta = JsonUtil.getString(jsonObj, "meta");

obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at");
Expand All @@ -207,10 +165,6 @@ public String toString() {
+ subscriptionId
+ ", status="
+ status
+ ", alarmTriggeredAt="
+ alarmTriggeredAt
+ ", scope="
+ scope
+ ", meta="
+ meta
+ ", createdAt="
Expand All @@ -233,8 +187,6 @@ public boolean equals(Object o) {
&& java.util.Objects.equals(meteredFeatureId, that.meteredFeatureId)
&& java.util.Objects.equals(subscriptionId, that.subscriptionId)
&& java.util.Objects.equals(status, that.status)
&& java.util.Objects.equals(alarmTriggeredAt, that.alarmTriggeredAt)
&& java.util.Objects.equals(scope, that.scope)
&& java.util.Objects.equals(meta, that.meta)
&& java.util.Objects.equals(createdAt, that.createdAt)
&& java.util.Objects.equals(updatedAt, that.updatedAt);
Expand All @@ -251,8 +203,6 @@ public int hashCode() {
meteredFeatureId,
subscriptionId,
status,
alarmTriggeredAt,
scope,
meta,
createdAt,
updatedAt);
Expand Down
Loading
Loading