Skip to content

Commit ce92dab

Browse files
adding model, interface and implementation for ListSpaceQuotaDefinition
1 parent 4a6840a commit ce92dab

File tree

6 files changed

+166
-0
lines changed

6 files changed

+166
-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
@@ -20,6 +20,8 @@
2020
import org.cloudfoundry.client.v3.spacequotadefinitions.CreateSpaceQuotaDefinitionResponse;
2121
import org.cloudfoundry.client.v3.spacequotadefinitions.GetSpaceQuotaDefinitionRequest;
2222
import org.cloudfoundry.client.v3.spacequotadefinitions.GetSpaceQuotaDefinitionResponse;
23+
import org.cloudfoundry.client.v3.spacequotadefinitions.ListSpaceQuotaDefinitionsRequest;
24+
import org.cloudfoundry.client.v3.spacequotadefinitions.ListSpaceQuotaDefinitionsResponse;
2325
import org.cloudfoundry.client.v3.spacequotadefinitions.SpaceQuotaDefinitionsV3;
2426
import org.cloudfoundry.reactor.ConnectionContext;
2527
import org.cloudfoundry.reactor.TokenProvider;
@@ -69,5 +71,13 @@ public Mono<GetSpaceQuotaDefinitionResponse> get(GetSpaceQuotaDefinitionRequest
6971
.checkpoint();
7072
}
7173

74+
@Override
75+
public Mono<ListSpaceQuotaDefinitionsResponse> list(ListSpaceQuotaDefinitionsRequest request) {
76+
return get(
77+
request,
78+
ListSpaceQuotaDefinitionsResponse.class,
79+
builder -> builder.pathSegment("space_quotas"))
80+
.checkpoint();
81+
}
7282

7383
}

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,14 @@ Mono<CreateSpaceQuotaDefinitionResponse> create(
4242
*/
4343
Mono<GetSpaceQuotaDefinitionResponse> get(
4444
GetSpaceQuotaDefinitionRequest request);
45+
46+
/**
47+
* Makes the <a href="https://v3-apidocs.cloudfoundry.org/version/3.201.0/#list-space-quotas">List all Space Quota Definitions request</a>
48+
*
49+
* @param request the List all Space Quota Definitions request
50+
* @return the response from the Space all Organization Quota Definitions request
51+
*/
52+
Mono<ListSpaceQuotaDefinitionsResponse> list(
53+
ListSpaceQuotaDefinitionsRequest request);
54+
4555
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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.cloudfoundry.Nullable;
20+
import org.cloudfoundry.client.v3.FilterParameter;
21+
import org.cloudfoundry.client.v3.PaginatedRequest;
22+
import org.immutables.value.Value;
23+
24+
import java.util.List;
25+
26+
/**
27+
* The request payload for the List all Space Quota Definitions operation
28+
*/
29+
@Value.Immutable
30+
abstract class _ListSpaceQuotaDefinitionsRequest extends PaginatedRequest {
31+
32+
/**
33+
* Comma-delimited list of space quota guids to filter by
34+
*/
35+
@FilterParameter("guids")
36+
@Nullable
37+
abstract List<String> getGuids();
38+
39+
/**
40+
* Comma-delimited list of space quota names to filter by
41+
*/
42+
@FilterParameter("names")
43+
@Nullable
44+
abstract List<String> getNames();
45+
46+
/**
47+
* Comma-delimited list of organization guids to filter by
48+
*/
49+
@FilterParameter("organization_guids")
50+
@Nullable
51+
abstract List<String> getOrganizationGuids();
52+
53+
/**
54+
* Comma-delimited list of space guids to filter by
55+
*/
56+
@FilterParameter("space_guids")
57+
@Nullable
58+
abstract List<String> getSpaceGuids();
59+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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.cloudfoundry.client.v3.PaginatedResponse;
21+
import org.immutables.value.Value;
22+
23+
/**
24+
* The response payload for the List all Space Quota Definitions operation
25+
*/
26+
@JsonDeserialize
27+
@Value.Immutable
28+
abstract class _ListSpaceQuotaDefinitionsResponse extends PaginatedResponse<SpaceQuotaDefinitionResource> {
29+
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
* Base class for resources that contain Space Quota Definitions
24+
*/
25+
@JsonDeserialize
26+
@Value.Immutable
27+
abstract class _SpaceQuotaDefinitionResource extends SpaceQuotaDefinition {
28+
29+
}
30+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
public class ListSpaceQuotaDefinitionsRequestTest {
22+
23+
@Test
24+
void valid() {
25+
ListSpaceQuotaDefinitionsRequest.builder().build();
26+
}
27+
}

0 commit comments

Comments
 (0)