Skip to content

Commit 6a5e675

Browse files
issue-1168 adding interface and model for UpdateOrganizationQuotaDefinition
1 parent ab8bf51 commit 6a5e675

File tree

4 files changed

+139
-0
lines changed

4 files changed

+139
-0
lines changed

cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/organizationquotadefinitions/OrganizationQuotaDefinitionsV3.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,13 @@ Mono<GetOrganizationQuotaDefinitionResponse> get(
5252
*/
5353
Mono<ListOrganizationQuotaDefinitionsResponse> list(
5454
ListOrganizationQuotaDefinitionsRequest request);
55+
56+
/** Makes the <a href="https://v3-apidocs.cloudfoundry.org/version/3.200.0/index.html#update-organization-quota-definition">Update Organization Quota Definition</a>
57+
* request
58+
*
59+
* @param request the Update Organization Quota Definition request
60+
* @return the response from the Update Organization Quota Definition request
61+
*/
62+
Mono<UpdateOrganizationQuotaDefinitionResponse> update(
63+
UpdateOrganizationQuotaDefinitionRequest request);
5564
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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.organizationquotadefinitions;
18+
19+
import com.fasterxml.jackson.annotation.JsonIgnore;
20+
import com.fasterxml.jackson.annotation.JsonProperty;
21+
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
22+
import org.cloudfoundry.Nullable;
23+
import org.immutables.value.Value;
24+
25+
/**
26+
* The request payload to update an organization quota
27+
*/
28+
@JsonSerialize
29+
@Value.Immutable
30+
abstract class _UpdateOrganizationQuotaDefinitionRequest {
31+
32+
/**
33+
* The quota definition id
34+
*/
35+
@JsonIgnore
36+
abstract String getOrganizationQuotaDefinitionId();
37+
38+
/**
39+
* Name of the quota
40+
*/
41+
@JsonProperty("name")
42+
@Nullable
43+
abstract String getName();
44+
45+
/**
46+
* Quotas that affect applications and application sub-resources
47+
*/
48+
@JsonProperty("apps")
49+
@Nullable
50+
abstract Apps getApps();
51+
52+
/**
53+
* Quotas that affect services
54+
*/
55+
@JsonProperty("services")
56+
@Nullable
57+
abstract Services getServices();
58+
59+
/**
60+
* Quotas that affect routes
61+
*/
62+
@JsonProperty("routes")
63+
@Nullable
64+
abstract Routes getRoutes();
65+
}
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.organizationquotadefinitions;
18+
19+
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
20+
import org.immutables.value.Value;
21+
22+
/**
23+
* The response payload for the Update an Organization Quota Definition operation
24+
*/
25+
@JsonDeserialize
26+
@Value.Immutable
27+
abstract class _UpdateOrganizationQuotaDefinitionResponse extends OrganizationQuotaDefinition {
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.organizationquotadefinitions;
18+
19+
import org.junit.jupiter.api.Test;
20+
21+
import static org.junit.jupiter.api.Assertions.assertThrows;
22+
23+
final class UpdateOrganizationQuotaDefinitionRequestTest {
24+
25+
@Test
26+
void noOrganizationId() {
27+
assertThrows(
28+
IllegalStateException.class,
29+
() -> UpdateOrganizationQuotaDefinitionRequest.builder().build());
30+
}
31+
32+
@Test
33+
void valid() {
34+
UpdateOrganizationQuotaDefinitionRequest.builder().organizationQuotaDefinitionId("test-id").build();
35+
}
36+
}

0 commit comments

Comments
 (0)