Skip to content

Commit e6570c2

Browse files
issue-1168 adding reactor implementation for Create, Get, List, Update and Delete OrganizationQuotaDefinition
1 parent 8249d70 commit e6570c2

File tree

9 files changed

+607
-0
lines changed

9 files changed

+607
-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,105 @@
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 org.cloudfoundry.client.v3.organizationquotadefinitions.CreateOrganizationQuotaDefinitionRequest;
20+
import org.cloudfoundry.client.v3.organizationquotadefinitions.CreateOrganizationQuotaDefinitionResponse;
21+
import org.cloudfoundry.client.v3.organizationquotadefinitions.DeleteOrganizationQuotaDefinitionRequest;
22+
import org.cloudfoundry.client.v3.organizationquotadefinitions.GetOrganizationQuotaDefinitionRequest;
23+
import org.cloudfoundry.client.v3.organizationquotadefinitions.GetOrganizationQuotaDefinitionResponse;
24+
import org.cloudfoundry.client.v3.organizationquotadefinitions.ListOrganizationQuotaDefinitionsRequest;
25+
import org.cloudfoundry.client.v3.organizationquotadefinitions.ListOrganizationQuotaDefinitionsResponse;
26+
import org.cloudfoundry.client.v3.organizationquotadefinitions.OrganizationQuotaDefinitionsV3;
27+
import org.cloudfoundry.client.v3.organizationquotadefinitions.UpdateOrganizationQuotaDefinitionRequest;
28+
import org.cloudfoundry.client.v3.organizationquotadefinitions.UpdateOrganizationQuotaDefinitionResponse;
29+
import org.cloudfoundry.reactor.ConnectionContext;
30+
import org.cloudfoundry.reactor.TokenProvider;
31+
import org.cloudfoundry.reactor.client.v3.AbstractClientV3Operations;
32+
import reactor.core.publisher.Mono;
33+
34+
import java.util.Map;
35+
36+
/**
37+
* The Reactor-based implementation of {@link ReactorOrganizationQuotaDefinitionsV3}
38+
*/
39+
public class ReactorOrganizationQuotaDefinitionsV3 extends AbstractClientV3Operations
40+
implements OrganizationQuotaDefinitionsV3 {
41+
42+
/**
43+
* Creates an instance
44+
*
45+
* @param connectionContext the {@link ConnectionContext} to use when communicating with the server
46+
* @param root the root URI of the server. Typically, something like {@code https://api.run.pivotal.io}.
47+
* @param tokenProvider the {@link TokenProvider} to use when communicating with the server
48+
* @param requestTags map with custom http headers which will be added to web request
49+
*/
50+
public ReactorOrganizationQuotaDefinitionsV3(
51+
ConnectionContext connectionContext,
52+
Mono<String> root,
53+
TokenProvider tokenProvider,
54+
Map<String, String> requestTags) {
55+
super(connectionContext, root, tokenProvider, requestTags);
56+
}
57+
58+
@Override
59+
public Mono<CreateOrganizationQuotaDefinitionResponse> create(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(GetOrganizationQuotaDefinitionRequest request) {
69+
return get(
70+
request,
71+
GetOrganizationQuotaDefinitionResponse.class,
72+
builder ->
73+
builder.pathSegment("organization_quotas", request.getOrganizationQuotaDefinitionId()))
74+
.checkpoint();
75+
}
76+
77+
78+
@Override
79+
public Mono<ListOrganizationQuotaDefinitionsResponse> list(ListOrganizationQuotaDefinitionsRequest request) {
80+
return get(
81+
request,
82+
ListOrganizationQuotaDefinitionsResponse.class,
83+
builder -> builder.pathSegment("organization_quotas"))
84+
.checkpoint();
85+
}
86+
87+
@Override
88+
public Mono<UpdateOrganizationQuotaDefinitionResponse> update(UpdateOrganizationQuotaDefinitionRequest request) {
89+
return patch(
90+
request,
91+
UpdateOrganizationQuotaDefinitionResponse.class,
92+
builder ->
93+
builder.pathSegment("organization_quotas", request.getOrganizationQuotaDefinitionId()))
94+
.checkpoint();
95+
}
96+
97+
@Override
98+
public Mono<String> delete(DeleteOrganizationQuotaDefinitionRequest request) {
99+
return delete(
100+
request,
101+
builder ->
102+
builder.pathSegment("organization_quotas", request.getOrganizationQuotaDefinitionId()))
103+
.checkpoint();
104+
}
105+
}

0 commit comments

Comments
 (0)