Skip to content

Commit 76d5ae6

Browse files
adding model, interface and implementation for DeleteSpaceQuotaDefinition
1 parent d0876ee commit 76d5ae6

File tree

4 files changed

+89
-0
lines changed

4 files changed

+89
-0
lines changed

cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/client/v3/spacequotadefinition/ReactorSpaceQuotaDefinitionsV3.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import org.cloudfoundry.client.v3.spacequotadefinitions.CreateSpaceQuotaDefinitionRequest;
2020
import org.cloudfoundry.client.v3.spacequotadefinitions.CreateSpaceQuotaDefinitionResponse;
21+
import org.cloudfoundry.client.v3.spacequotadefinitions.DeleteSpaceQuotaDefinitionRequest;
2122
import org.cloudfoundry.client.v3.spacequotadefinitions.GetSpaceQuotaDefinitionRequest;
2223
import org.cloudfoundry.client.v3.spacequotadefinitions.GetSpaceQuotaDefinitionResponse;
2324
import org.cloudfoundry.client.v3.spacequotadefinitions.ListSpaceQuotaDefinitionsRequest;
@@ -92,4 +93,13 @@ public Mono<UpdateSpaceQuotaDefinitionResponse> update(UpdateSpaceQuotaDefinitio
9293
.checkpoint();
9394
}
9495

96+
@Override
97+
public Mono<String> delete(DeleteSpaceQuotaDefinitionRequest request) {
98+
return delete(
99+
request,
100+
builder ->
101+
builder.pathSegment("organization_quotas", request.getSpaceQuotaDefinitionId()))
102+
.checkpoint();
103+
}
104+
95105
}

cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/spacequotadefinitions/SpaceQuotaDefinitionsV3.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,13 @@ Mono<ListSpaceQuotaDefinitionsResponse> list(
6262
Mono<UpdateSpaceQuotaDefinitionResponse> update(
6363
UpdateSpaceQuotaDefinitionRequest request);
6464

65+
/**
66+
* Makes the <a href="https://v3-apidocs.cloudfoundry.org/version/3.123.0/index.html#delete-a-space-quota">Delete Space Quota Definition</a>
67+
* request
68+
*
69+
* @param request the Delete Space Quota Definition request
70+
* @return the response from the Space Organization Quota Definition request
71+
*/
72+
Mono<String> delete(
73+
DeleteSpaceQuotaDefinitionRequest request);
6574
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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.client.v3.spacequotadefinitions;
18+
19+
import com.fasterxml.jackson.annotation.JsonIgnore;
20+
import org.immutables.value.Value;
21+
22+
/**
23+
* The request payload for the Delete an Space Quota Definition operation
24+
*/
25+
@Value.Immutable
26+
abstract class _DeleteSpaceQuotaDefinitionRequest {
27+
28+
/**
29+
* The quota definition id
30+
*/
31+
@JsonIgnore
32+
abstract String getSpaceQuotaDefinitionId();
33+
34+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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.client.v3.spacequotadefinitions;
18+
19+
import org.junit.jupiter.api.Test;
20+
21+
import static org.junit.jupiter.api.Assertions.assertThrows;
22+
23+
final class DeleteSpaceQuotaDefinitionRequestTest {
24+
25+
@Test
26+
void noSpaceQuotaDefinitionId() {
27+
assertThrows(
28+
IllegalStateException.class,
29+
() -> DeleteSpaceQuotaDefinitionRequest.builder().build());
30+
}
31+
32+
@Test
33+
void valid() {
34+
DeleteSpaceQuotaDefinitionRequest.builder().spaceQuotaDefinitionId("test-id").build();
35+
}
36+
}

0 commit comments

Comments
 (0)