@Override
    public void write(DocWriter writer, String previousText, ShapeDetailsSection section) {
        if (section.shape().isMemberShape()) {
            writer.openAdmonition(NoticeType.NOTE);
            writer.write("""
                    This value will be used by the service to ensure the request is $R. \
                    Clients SHOULD automatically populate this (typically with a $R) if \
                    it was not explicitly set.

                    """, IDEMPOTENT_REF, UUID_REF);
            writer.closeAdmonition();
            writer.writeWithNoFormatting(previousText);
            return;
        }

        var operation = section.shape().asOperationShape().get();
        var idempotencyToken = getIdempotencyToken(section.context().model(), operation)
                .map(member -> section.context().symbolProvider().toSymbol(member))
                .map(symbol -> SymbolReference.builder()
                        .alias(String.format("idempotency token (%s)", symbol.getName()))
                        .symbol(symbol)
                        .build());
        writer.putContext("token", idempotencyToken);
        writer.openAdmonition(NoticeType.NOTE);
        writer.write("""
                This operation is $R${?token} when the ${token:R} is set${/token}.

                """, IDEMPOTENT_REF);
        writer.closeAdmonition();
        writer.writeWithNoFormatting(previousText);
    }
Provides information about idempotency depending on a number of traits.
smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/IdempotencyInterceptor.java