public TimestampFormatTrait.Format determineTimestampFormat(
            ToShapeId member,
            HttpBinding.Location location,
            TimestampFormatTrait.Format defaultFormat
    ) {
        Model model = getModel();
        return model.getShape(member.toShapeId())
                // Use the timestampFormat trait on the member or target if present.
                .flatMap(shape -> shape.getMemberTrait(model, TimestampFormatTrait.class))
                .map(TimestampFormatTrait::getFormat)
                .orElseGet(() -> {
                    // Determine the format based on the location.
                    switch (location) {
                        case PREFIX_HEADERS:
                        case HEADER:
                            return TimestampFormatTrait.Format.HTTP_DATE;
                        case QUERY:
                        case LABEL:
                            return TimestampFormatTrait.Format.DATE_TIME;
                        default:
                            return defaultFormat;
                    }
                });
    }
Determines the appropriate timestamp format for a member shape bound to
a specific location.

@param member Member to derive the timestamp format.
@param location Location the member is bound to.
@param defaultFormat The format to use for the body or a default.
@return Returns the determined timestamp format.
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/HttpBindingIndex.java