Skip to content

Commit 258f7ca

Browse files
fix IamPolicy code example docs. (#4324)
Co-authored-by: Debora N. Ito <[email protected]>
1 parent bece74c commit 258f7ca

File tree

1 file changed

+3
-2
lines changed
  • services-custom/iam-policy-builder/src/main/java/software/amazon/awssdk/policybuilder/iam

1 file changed

+3
-2
lines changed

services-custom/iam-policy-builder/src/main/java/software/amazon/awssdk/policybuilder/iam/IamPolicy.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@
8080
* String policyVersion = getPolicyResponse.defaultVersionId();
8181
* GetPolicyVersionResponse getPolicyVersionResponse =
8282
* iam.getPolicyVersion(r -> r.policyArn(policyArn).versionId(policyVersion));
83-
*
84-
* IamPolicy policy = IamPolicy.fromJson(getPolicyVersionResponse.policyVersion().document());
83+
*
84+
* String decodedPolicy = URLDecoder.decode(getPolicyVersionResponse.policyVersion().document(), StandardCharsets.UTF_8);
85+
* IamPolicy policy = IamPolicy.fromJson(decodedPolicy);
8586
*
8687
* IamStatement newStatement = policy.statements().get(0).copy(s -> s.addAction("dynamodb:GetItem"));
8788
* IamPolicy newPolicy = policy.copy(p -> p.statements(Arrays.asList(newStatement)));

0 commit comments

Comments
 (0)