feat(apigateway): implement account management endpoints and models (#867)

* feat(apigateway): implement account management endpoints and models
* feat(apigateway): enhance patch operation validation and update throttle settings defaults
* feat(api-gateway): add account management operations to API Gateway v1
* feat(api-gateway): add compatibility tests for account management and update logic
* feat(api-gateway): add missing import for assertions in account compatibility test
This commit is contained in:
Prakhar Kapoor authored and GitHub committed 2026-05-17 23:42:09 -05:00
1 parent 647b170494
commit 15720e2ee6
9 files changed
+504 -31

No files matched your search

@@ -0,0 +1,38 @@
package com.floci.test;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
import software.amazon.awssdk.services.apigateway.ApiGatewayClient;
import software.amazon.awssdk.services.apigateway.model.GetAccountRequest;
import software.amazon.awssdk.services.apigateway.model.GetAccountResponse;
import software.amazon.awssdk.services.apigateway.model.UpdateAccountRequest;
import software.amazon.awssdk.services.apigateway.model.PatchOperation;
class ApiGatewayAccountCompatibilityTest {
@Test
void getAndUpdateAccount_viaSdk() {
ApiGatewayClient apigw = TestFixtures.apiGatewayClient();
GetAccountResponse before = apigw.getAccount(GetAccountRequest.builder().build());
assertThat(before.apiKeyVersion()).isNotBlank();
assertThat(before.features()).contains("UsagePlans");
assertThat(before.throttleSettings()).isNotNull();
String arn = "arn:aws:iam::123456789012:role/apigAwsProxyRole";
PatchOperation op = PatchOperation.builder()
.op("replace")
.path("/cloudwatchRoleArn")
.value(arn)
.build();
apigw.updateAccount(UpdateAccountRequest.builder().patchOperations(op).build());
GetAccountResponse after = apigw.getAccount(GetAccountRequest.builder().build());
assertThat(after.cloudwatchRoleArn()).isEqualTo(arn);
// cleanup
PatchOperation remove = PatchOperation.builder().op("remove").path("/cloudwatchRoleArn").build();
apigw.updateAccount(UpdateAccountRequest.builder().patchOperations(remove).build());
}
}