Class DefaultIamPolicy
java.lang.Object
software.amazon.awssdk.policybuilder.iam.internal.DefaultIamPolicy
- All Implemented Interfaces:
IamPolicy,ToCopyableBuilder<IamPolicy.Builder,IamPolicy>
Default implementation of
IamPolicy.- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultIamPolicy.Builderbuilder()booleaninthashCode()id()Retrieve the value set byIamPolicy.Builder.id(String).Retrieve the value set byIamPolicy.Builder.statements(Collection).Take this object and create a builder that contains all of the current property values of this object.toJson()Convert this policy to the JSON format that is accepted by AWS services.toJson(IamPolicyWriter writer) Convert this policy to the JSON format that is accepted by AWS services, using the provided writer.toString()version()Retrieve the value set byIamPolicy.Builder.version(String).Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Constructor Details
-
DefaultIamPolicy
-
-
Method Details
-
builder
-
id
Description copied from interface:IamPolicyRetrieve the value set byIamPolicy.Builder.id(String). -
version
Description copied from interface:IamPolicyRetrieve the value set byIamPolicy.Builder.version(String). -
statements
Description copied from interface:IamPolicyRetrieve the value set byIamPolicy.Builder.statements(Collection).- Specified by:
statementsin interfaceIamPolicy
-
toJson
Description copied from interface:IamPolicyConvert this policy to the JSON format that is accepted by AWS services.This is equivalent to
IamPolicyWriter.create().writeToString(policy)IamPolicy policy = IamPolicy.builder() .addStatement(IamStatement.builder() .effect(IamEffect.ALLOW) .addAction("dynamodb:PutItem") .addResource("arn:aws:dynamodb:us-east-2:123456789012:table/books") .build()) .build(); System.out.println("Policy:\n" + policy.toJson()); -
toJson
Description copied from interface:IamPolicyConvert this policy to the JSON format that is accepted by AWS services, using the provided writer.This is equivalent to
writer.writeToString(policy)IamPolicyWriter prettyWriter = IamPolicyWriter.builder() .prettyPrint(true) .build(); IamPolicy policy = IamPolicy.builder() .addStatement(IamStatement.builder() .effect(IamEffect.ALLOW) .addAction("dynamodb:PutItem") .addResource("arn:aws:dynamodb:us-east-2:123456789012:table/books") .build()) .build(); System.out.println("Policy:\n" + policy.toJson(prettyWriter)); -
toBuilder
Description copied from interface:ToCopyableBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilderin interfaceToCopyableBuilder<IamPolicy.Builder,IamPolicy> - Returns:
- a builder for type T
-
equals
-
hashCode
-
toString
-