public static String resolveResourceName(ResourceShape resource) {
        return resource.getTrait(IamResourceTrait.class)
                .flatMap(IamResourceTrait::getName)
                .orElse(resource.getId().getName());
    }
Resolves the IAM resource name for the given resource. Uses the following
resolution order:

<ol>
    <li>Value of the {@code @iamResource} trait's {@code name} property</li>
    <li>The resource's name</li>
</ol>

@param resource the resource to resolve a name for.
@return The resolved resource name.
smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/IamResourceTrait.java