public Map<String, AttributeValue> buildTableAttributeValuesMapFromTicket(
        final TicketPayload payload) {
        val values = new HashMap<String, AttributeValue>();
        val ttl = Optional.ofNullable(payload.getOriginalTicket().getExpirationPolicy().toMaximumExpirationTime(payload.getOriginalTicket()))
            .or(() -> Optional.ofNullable(NeverExpiresExpirationPolicy.INSTANCE.toMaximumExpirationTime(payload.getEncodedTicket())))
            .map(ChronoZonedDateTime::toEpochSecond)
            .orElse(-1L);

        values.put(ColumnNames.ATTRIBUTES.getColumnName(),
            AttributeValue.builder().m(convertAttributes(payload)).build());
        values.put(ColumnNames.EXPIRATION.getColumnName(),
            AttributeValue.builder().n(String.valueOf(ttl)).build());
        values.put(ColumnNames.ID.getColumnName(),
            AttributeValue.builder().s(payload.getEncodedTicket().getId()).build());
        values.put(ColumnNames.PRINCIPAL.getColumnName(),
            AttributeValue.builder().s(payload.getPrincipal()).build());
        values.put(ColumnNames.SERVICE.getColumnName(),
            AttributeValue.builder().s(payload.getService()).build());
        values.put(ColumnNames.PREFIX.getColumnName(),
            AttributeValue.builder().s(payload.getOriginalTicket().getPrefix()).build());
        values.put(ColumnNames.CREATION_TIME.getColumnName(), AttributeValue.builder().
            s(payload.getOriginalTicket().getCreationTime().toString()).build());
        values.put(ColumnNames.COUNT_OF_USES.getColumnName(),
            AttributeValue.builder().n(Integer.toString(payload.getOriginalTicket().getCountOfUses())).build());
        values.put(ColumnNames.TIME_TO_LIVE.getColumnName(),
            AttributeValue.builder().n(Long.toString(payload.getOriginalTicket().getExpirationPolicy().getTimeToLive())).build());

        val idleTimeout = payload.getOriginalTicket().getExpirationPolicy() instanceof final IdleExpirationPolicy iep ? Long.toString(iep.getTimeToIdle()) : "0";
        values.put(ColumnNames.TIME_TO_IDLE.getColumnName(), AttributeValue.builder().n(idleTimeout).build());

        values.put(ColumnNames.ENCODED.getColumnName(),
            AttributeValue.builder().b(SdkBytes.fromByteBuffer(ByteBuffer.wrap(SerializationUtils.serialize(payload.getEncodedTicket())))).build());
        LOGGER.debug("Created attribute values [{}] based on provided ticket [{}]", values, payload.getEncodedTicket().getId());
        return values;
    }
Build table attribute values from ticket map.

@param payload the payload
@return the map
support/cas-server-support-dynamodb-ticket-registry/src/main/java/org/apereo/cas/ticket/registry/DynamoDbTicketRegistryFacilitator.java