From 73ae3936f680d33c1173c36447a015607a131581 Mon Sep 17 00:00:00 2001 From: Malinda Ranasinghe Date: Thu, 13 Aug 2026 09:29:27 +0200 Subject: [PATCH] feat(usage): deprecate legacy periodic-usage endpoints [MOI-7252] --- .../contentful/java/cma/ModuleOrganizationUsage.java | 8 ++++++++ .../com/contentful/java/cma/ModuleSpaceUsage.java | 8 ++++++++ .../java/cma/ServiceOrganizationUsage.java | 12 ++++++++++++ .../com/contentful/java/cma/ServiceSpaceUsage.java | 12 ++++++++++++ .../java/com/contentful/java/cma/model/CMAUsage.java | 7 +++++++ 5 files changed, 47 insertions(+) diff --git a/src/main/java/com/contentful/java/cma/ModuleOrganizationUsage.java b/src/main/java/com/contentful/java/cma/ModuleOrganizationUsage.java index bde6ff71..001bcb15 100644 --- a/src/main/java/com/contentful/java/cma/ModuleOrganizationUsage.java +++ b/src/main/java/com/contentful/java/cma/ModuleOrganizationUsage.java @@ -37,7 +37,11 @@ protected ServiceOrganizationUsage createService(Retrofit retrofit) { * * @param query the criteria to narrow down the search result. * @return {@link CMAUsage} result instance + * @deprecated The {@code GET /organizations/{organization_id}/organization_periodic_usages} + * endpoint is deprecated in favor of the new Usage API. It will be removed on + * 2027-02-28, after which requests will return 410 Gone. */ + @Deprecated public CMAArray fetchAll( String organizationId, Map query) { @@ -66,7 +70,11 @@ public class Async { * @return {@link CMAUsage} result callback. + * @deprecated The {@code GET /organizations/{organization_id}/organization_periodic_usages} + * endpoint is deprecated in favor of the new Usage API. It will be removed on + * 2027-02-28, after which requests will return 410 Gone. */ + @Deprecated public CMACallback> fetchAll( String organizationId, Map query, diff --git a/src/main/java/com/contentful/java/cma/ModuleSpaceUsage.java b/src/main/java/com/contentful/java/cma/ModuleSpaceUsage.java index d7d7b948..e9367e09 100644 --- a/src/main/java/com/contentful/java/cma/ModuleSpaceUsage.java +++ b/src/main/java/com/contentful/java/cma/ModuleSpaceUsage.java @@ -37,7 +37,11 @@ protected ServiceSpaceUsage createService(Retrofit retrofit) { * @param organizationId organization id for the request. * @param query the criteria to narrow down the search result. * @return {@link CMAUsage} result instance + * @deprecated The {@code GET /organizations/{organization_id}/space_periodic_usages} + * endpoint is deprecated in favor of the new Usage API. It will be removed on + * 2027-02-28, after which requests will return 410 Gone. */ + @Deprecated public CMAArray fetchAll( String organizationId, Map query) { @@ -66,7 +70,11 @@ public class Async { * @param organizationId organization id for the request. * @param query possible parameters of the request. * @return {@link CMAUsage} result callback. + * @deprecated The {@code GET /organizations/{organization_id}/space_periodic_usages} + * endpoint is deprecated in favor of the new Usage API. It will be removed on + * 2027-02-28, after which requests will return 410 Gone. */ + @Deprecated public CMACallback> fetchAll( String organizationId, Map query, diff --git a/src/main/java/com/contentful/java/cma/ServiceOrganizationUsage.java b/src/main/java/com/contentful/java/cma/ServiceOrganizationUsage.java index 19509525..ecea8061 100644 --- a/src/main/java/com/contentful/java/cma/ServiceOrganizationUsage.java +++ b/src/main/java/com/contentful/java/cma/ServiceOrganizationUsage.java @@ -11,11 +11,23 @@ public interface ServiceOrganizationUsage { + /** + * @deprecated The {@code GET /organizations/{organization_id}/organization_periodic_usages} + * endpoint is deprecated in favor of the new Usage API. It will be removed on + * 2027-02-28, after which requests will return 410 Gone. + */ + @Deprecated @GET("organizations/{organization_id}/organization_periodic_usages") Flowable> fetchAll( @Path("organization_id") String organizationId ); + /** + * @deprecated The {@code GET /organizations/{organization_id}/organization_periodic_usages} + * endpoint is deprecated in favor of the new Usage API. It will be removed on + * 2027-02-28, after which requests will return 410 Gone. + */ + @Deprecated @GET("organizations/{organization_id}/organization_periodic_usages") Flowable> fetchAll( @Path("organization_id") String organizationId, diff --git a/src/main/java/com/contentful/java/cma/ServiceSpaceUsage.java b/src/main/java/com/contentful/java/cma/ServiceSpaceUsage.java index b726d4fa..71041352 100644 --- a/src/main/java/com/contentful/java/cma/ServiceSpaceUsage.java +++ b/src/main/java/com/contentful/java/cma/ServiceSpaceUsage.java @@ -10,11 +10,23 @@ import java.util.Map; public interface ServiceSpaceUsage { + /** + * @deprecated The {@code GET /organizations/{organization_id}/space_periodic_usages} + * endpoint is deprecated in favor of the new Usage API. It will be removed on + * 2027-02-28, after which requests will return 410 Gone. + */ + @Deprecated @GET("organizations/{organization_id}/space_periodic_usages") Flowable> fetchAll( @Path("organization_id") String organizationId ); + /** + * @deprecated The {@code GET /organizations/{organization_id}/space_periodic_usages} + * endpoint is deprecated in favor of the new Usage API. It will be removed on + * 2027-02-28, after which requests will return 410 Gone. + */ + @Deprecated @GET("organizations/{organization_id}/space_periodic_usages") Flowable> fetchAll( @Path("organization_id") String organizationId, diff --git a/src/main/java/com/contentful/java/cma/model/CMAUsage.java b/src/main/java/com/contentful/java/cma/model/CMAUsage.java index 220f55c4..2fcfc387 100644 --- a/src/main/java/com/contentful/java/cma/model/CMAUsage.java +++ b/src/main/java/com/contentful/java/cma/model/CMAUsage.java @@ -2,6 +2,13 @@ import java.util.LinkedHashMap; +/** + * @deprecated The {@code GET /organizations/{organization_id}/organization_periodic_usages} + * and {@code GET /organizations/{organization_id}/space_periodic_usages} endpoints are + * deprecated in favor of the new Usage API. They will be removed on 2027-02-28, after + * which requests will return 410 Gone. + */ +@Deprecated public class CMAUsage extends CMAResource { private String unitOfMeasure; private UsageMetric metric;