Skip to content

Commit df9ece3

Browse files
Add organization quotas version 3 api (#1304)
1 parent 6667c56 commit df9ece3

File tree

33 files changed

+1852
-0
lines changed

33 files changed

+1852
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import org.cloudfoundry.client.v2.routemappings.RouteMappings;
3535
import org.cloudfoundry.client.v2.routes.Routes;
3636
import org.cloudfoundry.client.v2.securitygroups.SecurityGroups;
37+
import org.cloudfoundry.client.v3.organizationquotadefinitions.OrganizationQuotaDefinitionsV3;
3738
import org.cloudfoundry.client.v3.securitygroups.SecurityGroupsV3;
3839
import org.cloudfoundry.client.v2.servicebindings.ServiceBindingsV2;
3940
import org.cloudfoundry.client.v2.servicebrokers.ServiceBrokers;
@@ -92,6 +93,7 @@
9293
import org.cloudfoundry.reactor.client.v2.routemappings.ReactorRouteMappings;
9394
import org.cloudfoundry.reactor.client.v2.routes.ReactorRoutes;
9495
import org.cloudfoundry.reactor.client.v2.securitygroups.ReactorSecurityGroups;
96+
import org.cloudfoundry.reactor.client.v3.organizationquotadefinitions.ReactorOrganizationQuotaDefinitionsV3;
9597
import org.cloudfoundry.reactor.client.v3.securitygroups.ReactorSecurityGroupsV3;
9698
import org.cloudfoundry.reactor.client.v2.servicebindings.ReactorServiceBindingsV2;
9799
import org.cloudfoundry.reactor.client.v2.servicebrokers.ReactorServiceBrokers;
@@ -278,6 +280,13 @@ public OrganizationQuotaDefinitions organizationQuotaDefinitions() {
278280
getRequestTags());
279281
}
280282

283+
@Override
284+
@Value.Derived
285+
public OrganizationQuotaDefinitionsV3 organizationQuotaDefinitionsV3() {
286+
return new ReactorOrganizationQuotaDefinitionsV3(getConnectionContext(), getRootV3(), getTokenProvider(),
287+
getRequestTags());
288+
}
289+
281290
@Override
282291
@Value.Derived
283292
public Organizations organizations() {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
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.organizationquotadefinitions;
18+
19+
import java.util.Map;
20+
import org.cloudfoundry.client.v3.organizationquotadefinitions.CreateOrganizationQuotaDefinitionRequest;
21+
import org.cloudfoundry.client.v3.organizationquotadefinitions.CreateOrganizationQuotaDefinitionResponse;
22+
import org.cloudfoundry.client.v3.organizationquotadefinitions.DeleteOrganizationQuotaDefinitionRequest;
23+
import org.cloudfoundry.client.v3.organizationquotadefinitions.GetOrganizationQuotaDefinitionRequest;
24+
import org.cloudfoundry.client.v3.organizationquotadefinitions.GetOrganizationQuotaDefinitionResponse;
25+
import org.cloudfoundry.client.v3.organizationquotadefinitions.ListOrganizationQuotaDefinitionsRequest;
26+
import org.cloudfoundry.client.v3.organizationquotadefinitions.ListOrganizationQuotaDefinitionsResponse;
27+
import org.cloudfoundry.client.v3.organizationquotadefinitions.OrganizationQuotaDefinitionsV3;
28+
import org.cloudfoundry.client.v3.organizationquotadefinitions.UpdateOrganizationQuotaDefinitionRequest;
29+
import org.cloudfoundry.client.v3.organizationquotadefinitions.UpdateOrganizationQuotaDefinitionResponse;
30+
import org.cloudfoundry.reactor.ConnectionContext;
31+
import org.cloudfoundry.reactor.TokenProvider;
32+
import org.cloudfoundry.reactor.client.v3.AbstractClientV3Operations;
33+
import reactor.core.publisher.Mono;
34+
35+
/**
36+
* The Reactor-based implementation of {@link ReactorOrganizationQuotaDefinitionsV3}
37+
*/
38+
public class ReactorOrganizationQuotaDefinitionsV3 extends AbstractClientV3Operations
39+
implements OrganizationQuotaDefinitionsV3 {
40+
41+
/**
42+
* Creates an instance
43+
*
44+
* @param connectionContext the {@link ConnectionContext} to use when communicating with the server
45+
* @param root the root URI of the server. Typically, something like {@code https://api.run.pivotal.io}.
46+
* @param tokenProvider the {@link TokenProvider} to use when communicating with the server
47+
* @param requestTags map with custom http headers which will be added to web request
48+
*/
49+
public ReactorOrganizationQuotaDefinitionsV3(
50+
ConnectionContext connectionContext,
51+
Mono<String> root,
52+
TokenProvider tokenProvider,
53+
Map<String, String> requestTags) {
54+
super(connectionContext, root, tokenProvider, requestTags);
55+
}
56+
57+
@Override
58+
public Mono<CreateOrganizationQuotaDefinitionResponse> create(
59+
CreateOrganizationQuotaDefinitionRequest request) {
60+
return post(
61+
request,
62+
CreateOrganizationQuotaDefinitionResponse.class,
63+
builder -> builder.pathSegment("organization_quotas"))
64+
.checkpoint();
65+
}
66+
67+
@Override
68+
public Mono<GetOrganizationQuotaDefinitionResponse> get(
69+
GetOrganizationQuotaDefinitionRequest request) {
70+
return get(
71+
request,
72+
GetOrganizationQuotaDefinitionResponse.class,
73+
builder ->
74+
builder.pathSegment(
75+
"organization_quotas",
76+
request.getOrganizationQuotaDefinitionId()))
77+
.checkpoint();
78+
}
79+
80+
@Override
81+
public Mono<ListOrganizationQuotaDefinitionsResponse> list(
82+
ListOrganizationQuotaDefinitionsRequest request) {
83+
return get(
84+
request,
85+
ListOrganizationQuotaDefinitionsResponse.class,
86+
builder -> builder.pathSegment("organization_quotas"))
87+
.checkpoint();
88+
}
89+
90+
@Override
91+
public Mono<UpdateOrganizationQuotaDefinitionResponse> update(
92+
UpdateOrganizationQuotaDefinitionRequest request) {
93+
return patch(
94+
request,
95+
UpdateOrganizationQuotaDefinitionResponse.class,
96+
builder ->
97+
builder.pathSegment(
98+
"organization_quotas",
99+
request.getOrganizationQuotaDefinitionId()))
100+
.checkpoint();
101+
}
102+
103+
@Override
104+
public Mono<String> delete(DeleteOrganizationQuotaDefinitionRequest request) {
105+
return delete(
106+
request,
107+
builder ->
108+
builder.pathSegment(
109+
"organization_quotas",
110+
request.getOrganizationQuotaDefinitionId()))
111+
.checkpoint();
112+
}
113+
}

0 commit comments

Comments
 (0)