/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package software.amazon.awssdk.policybuilder.iam; import software.amazon.awssdk.annotations.SdkPublicApi; import software.amazon.awssdk.annotations.ThreadSafe; import software.amazon.awssdk.policybuilder.iam.internal.DefaultIamPolicyWriter; import software.amazon.awssdk.utils.builder.CopyableBuilder; import software.amazon.awssdk.utils.builder.ToCopyableBuilder; /** * The {@link IamPolicyReader} converts an {@link IamPolicy} into JSON. * *
* This method is inexpensive, allowing the creation of writers wherever they are needed. */ static IamPolicyWriter create() { return DefaultIamPolicyWriter.create(); } /** * Create a {@link Builder} for an {@code IamPolicyWriter}. */ static Builder builder() { return DefaultIamPolicyWriter.builder(); } /** * Write a policy to a {@link String}. *
* This does not validate that the provided policy is correct or valid. */ String writeToString(IamPolicy policy); /** * Write a policy to a {@code byte} array. *
* This does not validate that the provided policy is correct or valid.
*/
byte[] writeToBytes(IamPolicy policy);
/**
* @see #builder()
*/
interface Builder extends CopyableBuilder
* When set to true, this will add new lines and indentation to the output to make it easier for a human to read, at
* the expense of extra data (white space) being output.
*
* By default, this is {@code false}.
*/
Builder prettyPrint(Boolean prettyPrint);
}
}