Skip to content

Commit

Permalink
fix IamPolicy code example docs. (#4324)
Browse files Browse the repository at this point in the history
Co-authored-by: Debora N. Ito <476307+debora-ito@users.noreply.github.com>
  • Loading branch information
ManishDait and debora-ito committed Aug 24, 2023
1 parent bece74c commit 258f7ca
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@
* String policyVersion = getPolicyResponse.defaultVersionId();
* GetPolicyVersionResponse getPolicyVersionResponse =
* iam.getPolicyVersion(r -> r.policyArn(policyArn).versionId(policyVersion));
*
* IamPolicy policy = IamPolicy.fromJson(getPolicyVersionResponse.policyVersion().document());
*
* String decodedPolicy = URLDecoder.decode(getPolicyVersionResponse.policyVersion().document(), StandardCharsets.UTF_8);
* IamPolicy policy = IamPolicy.fromJson(decodedPolicy);
*
* IamStatement newStatement = policy.statements().get(0).copy(s -> s.addAction("dynamodb:GetItem"));
* IamPolicy newPolicy = policy.copy(p -> p.statements(Arrays.asList(newStatement)));
Expand Down

0 comments on commit 258f7ca

Please sign in to comment.