Skip to content

Commit 4a6840a

Browse files
adding model, interface and implementation for GetSpaceQuotaDefinition
1 parent c53cf2c commit 4a6840a

File tree

5 files changed

+123
-1
lines changed

5 files changed

+123
-1
lines changed

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

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

1919
import org.cloudfoundry.client.v3.spacequotadefinitions.CreateSpaceQuotaDefinitionRequest;
2020
import org.cloudfoundry.client.v3.spacequotadefinitions.CreateSpaceQuotaDefinitionResponse;
21+
import org.cloudfoundry.client.v3.spacequotadefinitions.GetSpaceQuotaDefinitionRequest;
22+
import org.cloudfoundry.client.v3.spacequotadefinitions.GetSpaceQuotaDefinitionResponse;
2123
import org.cloudfoundry.client.v3.spacequotadefinitions.SpaceQuotaDefinitionsV3;
2224
import org.cloudfoundry.reactor.ConnectionContext;
2325
import org.cloudfoundry.reactor.TokenProvider;
@@ -57,4 +59,15 @@ public Mono<CreateSpaceQuotaDefinitionResponse> create(CreateSpaceQuotaDefinitio
5759
.checkpoint();
5860
}
5961

62+
@Override
63+
public Mono<GetSpaceQuotaDefinitionResponse> get(GetSpaceQuotaDefinitionRequest request) {
64+
return get(
65+
request,
66+
GetSpaceQuotaDefinitionResponse.class,
67+
builder ->
68+
builder.pathSegment("space_quotas", request.getSpaceQuotaDefinitionId()))
69+
.checkpoint();
70+
}
71+
72+
6073
}

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,22 @@
2424
public interface SpaceQuotaDefinitionsV3 {
2525

2626
/**
27-
* Makes the <a href="https://v3-apidocs.cloudfoundry.org/version/3.200.0/index.html#create-space-quota-definition">Create Space Quota Definition</a>
27+
* Makes the <a href="https://v3-apidocs.cloudfoundry.org/version/3.201.0/#create-a-space-quota">Create Space Quota</a>
2828
* request
2929
*
3030
* @param request the Create Space Quota Definition request
3131
* @return the response from the Create Space Quota Definition request
3232
*/
3333
Mono<CreateSpaceQuotaDefinitionResponse> create(
3434
CreateSpaceQuotaDefinitionRequest request);
35+
36+
/**
37+
* Makes the <a href="https://v3-apidocs.cloudfoundry.org/version/3.201.0/#get-a-space-quota">Get Space Quota</a>
38+
* request
39+
*
40+
* @param request the Get Space Quota Definition request
41+
* @return the response from the Get Space Quota request
42+
*/
43+
Mono<GetSpaceQuotaDefinitionResponse> get(
44+
GetSpaceQuotaDefinitionRequest request);
3545
}
Lines changed: 34 additions & 0 deletions
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 Retrieve a Particular Space Quota Definition operation
24+
*/
25+
@Value.Immutable
26+
abstract class _GetSpaceQuotaDefinitionRequest {
27+
28+
/**
29+
* The quota definition id
30+
*/
31+
@JsonIgnore
32+
abstract String getSpaceQuotaDefinitionId();
33+
34+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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.databind.annotation.JsonDeserialize;
20+
import org.immutables.value.Value;
21+
22+
/**
23+
* The response payload for the Retrieve a Particular Space Quota Definition operation
24+
*/
25+
@JsonDeserialize
26+
@Value.Immutable
27+
abstract class _GetSpaceQuotaDefinitionResponse extends SpaceQuotaDefinition {
28+
29+
}
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 GetSpaceQuotaDefinitionRequestTest {
24+
25+
@Test
26+
void noSpaceQuotaDefinitionId() {
27+
assertThrows(
28+
IllegalStateException.class,
29+
() -> GetSpaceQuotaDefinitionRequest.builder().build());
30+
}
31+
32+
@Test
33+
void valid() {
34+
GetSpaceQuotaDefinitionRequest.builder().spaceQuotaDefinitionId("test-id").build();
35+
}
36+
}

0 commit comments

Comments
 (0)