Skip to content

Commit b39d36e

Browse files
organization quotas and space quota are reorganized (#1322)
* Removing references to Definition from Organization Quota * Reorganize the package for organization quota and space quota to a common quota package to better structure the quota code
1 parent 9659146 commit b39d36e

File tree

52 files changed

+333
-558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+333
-558
lines changed

cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/client/_ReactorCloudFoundryClient.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
import org.cloudfoundry.client.v3.droplets.Droplets;
6060
import org.cloudfoundry.client.v3.isolationsegments.IsolationSegments;
6161
import org.cloudfoundry.client.v3.jobs.JobsV3;
62-
import org.cloudfoundry.client.v3.organizationquotadefinitions.OrganizationQuotaDefinitionsV3;
62+
import org.cloudfoundry.client.v3.quotas.organizations.OrganizationQuotasV3;
6363
import org.cloudfoundry.client.v3.organizations.OrganizationsV3;
6464
import org.cloudfoundry.client.v3.packages.Packages;
6565
import org.cloudfoundry.client.v3.processes.Processes;
@@ -72,7 +72,7 @@
7272
import org.cloudfoundry.client.v3.serviceinstances.ServiceInstancesV3;
7373
import org.cloudfoundry.client.v3.serviceofferings.ServiceOfferingsV3;
7474
import org.cloudfoundry.client.v3.serviceplans.ServicePlansV3;
75-
import org.cloudfoundry.client.v3.spacequotas.SpaceQuotasV3;
75+
import org.cloudfoundry.client.v3.quotas.spaces.SpaceQuotasV3;
7676
import org.cloudfoundry.client.v3.spaces.SpacesV3;
7777
import org.cloudfoundry.client.v3.stacks.StacksV3;
7878
import org.cloudfoundry.client.v3.tasks.Tasks;
@@ -119,7 +119,7 @@
119119
import org.cloudfoundry.reactor.client.v3.droplets.ReactorDroplets;
120120
import org.cloudfoundry.reactor.client.v3.isolationsegments.ReactorIsolationSegments;
121121
import org.cloudfoundry.reactor.client.v3.jobs.ReactorJobsV3;
122-
import org.cloudfoundry.reactor.client.v3.organizationquotadefinitions.ReactorOrganizationQuotaDefinitionsV3;
122+
import org.cloudfoundry.reactor.client.v3.quotas.organizations.ReactorOrganizationQuotasV3;
123123
import org.cloudfoundry.reactor.client.v3.organizations.ReactorOrganizationsV3;
124124
import org.cloudfoundry.reactor.client.v3.packages.ReactorPackages;
125125
import org.cloudfoundry.reactor.client.v3.processes.ReactorProcesses;
@@ -132,7 +132,7 @@
132132
import org.cloudfoundry.reactor.client.v3.serviceinstances.ReactorServiceInstancesV3;
133133
import org.cloudfoundry.reactor.client.v3.serviceofferings.ReactorServiceOfferingsV3;
134134
import org.cloudfoundry.reactor.client.v3.serviceplans.ReactorServicePlansV3;
135-
import org.cloudfoundry.reactor.client.v3.spacequotas.ReactorSpaceQuotasV3;
135+
import org.cloudfoundry.reactor.client.v3.quotas.spaces.ReactorSpaceQuotasV3;
136136
import org.cloudfoundry.reactor.client.v3.spaces.ReactorSpacesV3;
137137
import org.cloudfoundry.reactor.client.v3.stacks.ReactorStacksV3;
138138
import org.cloudfoundry.reactor.client.v3.tasks.ReactorTasks;
@@ -284,8 +284,8 @@ public OrganizationQuotaDefinitions organizationQuotaDefinitions() {
284284

285285
@Override
286286
@Value.Derived
287-
public OrganizationQuotaDefinitionsV3 organizationQuotaDefinitionsV3() {
288-
return new ReactorOrganizationQuotaDefinitionsV3(getConnectionContext(), getRootV3(), getTokenProvider(),
287+
public OrganizationQuotasV3 organizationQuotasV3() {
288+
return new ReactorOrganizationQuotasV3(getConnectionContext(), getRootV3(), getTokenProvider(),
289289
getRequestTags());
290290
}
291291

cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/client/v3/organizationquotadefinitions/ReactorOrganizationQuotaDefinitionsV3.java

Lines changed: 0 additions & 113 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
/*
2+
* Copyright 2013-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.cloudfoundry.reactor.client.v3.quotas.organizations;
18+
19+
import java.util.Map;
20+
import org.cloudfoundry.client.v3.quotas.organizations.*;
21+
import org.cloudfoundry.reactor.ConnectionContext;
22+
import org.cloudfoundry.reactor.TokenProvider;
23+
import org.cloudfoundry.reactor.client.v3.AbstractClientV3Operations;
24+
import reactor.core.publisher.Mono;
25+
26+
/**
27+
* The Reactor-based implementation of {@link ReactorOrganizationQuotasV3}
28+
*/
29+
public class ReactorOrganizationQuotasV3 extends AbstractClientV3Operations
30+
implements OrganizationQuotasV3 {
31+
32+
/**
33+
* Creates an instance
34+
*
35+
* @param connectionContext the {@link ConnectionContext} to use when communicating with the server
36+
* @param root the root URI of the server. Typically, something like {@code https://api.run.pivotal.io}.
37+
* @param tokenProvider the {@link TokenProvider} to use when communicating with the server
38+
* @param requestTags map with custom http headers which will be added to web request
39+
*/
40+
public ReactorOrganizationQuotasV3(
41+
ConnectionContext connectionContext,
42+
Mono<String> root,
43+
TokenProvider tokenProvider,
44+
Map<String, String> requestTags) {
45+
super(connectionContext, root, tokenProvider, requestTags);
46+
}
47+
48+
@Override
49+
public Mono<CreateOrganizationQuotaResponse> create(CreateOrganizationQuotaRequest request) {
50+
return post(
51+
request,
52+
CreateOrganizationQuotaResponse.class,
53+
builder -> builder.pathSegment("organization_quotas"))
54+
.checkpoint();
55+
}
56+
57+
@Override
58+
public Mono<GetOrganizationQuotaResponse> get(GetOrganizationQuotaRequest request) {
59+
return get(
60+
request,
61+
GetOrganizationQuotaResponse.class,
62+
builder ->
63+
builder.pathSegment(
64+
"organization_quotas", request.getOrganizationQuotaId()))
65+
.checkpoint();
66+
}
67+
68+
@Override
69+
public Mono<ListOrganizationQuotasResponse> list(ListOrganizationQuotasRequest request) {
70+
return get(
71+
request,
72+
ListOrganizationQuotasResponse.class,
73+
builder -> builder.pathSegment("organization_quotas"))
74+
.checkpoint();
75+
}
76+
77+
@Override
78+
public Mono<UpdateOrganizationQuotaResponse> update(UpdateOrganizationQuotaRequest request) {
79+
return patch(
80+
request,
81+
UpdateOrganizationQuotaResponse.class,
82+
builder ->
83+
builder.pathSegment(
84+
"organization_quotas", request.getOrganizationQuotaId()))
85+
.checkpoint();
86+
}
87+
88+
@Override
89+
public Mono<String> delete(DeleteOrganizationQuotaRequest request) {
90+
return delete(
91+
request,
92+
builder ->
93+
builder.pathSegment(
94+
"organization_quotas", request.getOrganizationQuotaId()))
95+
.checkpoint();
96+
}
97+
}

cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/client/v3/spacequotas/ReactorSpaceQuotasV3.java renamed to cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/client/v3/quotas/spaces/ReactorSpaceQuotasV3.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.cloudfoundry.reactor.client.v3.spacequotas;
17+
package org.cloudfoundry.reactor.client.v3.quotas.spaces;
1818

1919
import java.util.Map;
20-
import org.cloudfoundry.client.v3.spacequotas.*;
21-
import org.cloudfoundry.client.v3.spacequotas.CreateSpaceQuotaResponse;
20+
import org.cloudfoundry.client.v3.quotas.spaces.*;
2221
import org.cloudfoundry.reactor.ConnectionContext;
2322
import org.cloudfoundry.reactor.TokenProvider;
2423
import org.cloudfoundry.reactor.client.v3.AbstractClientV3Operations;

0 commit comments

Comments
 (0)