private List<ValidationEvent> validateResource(Model model, ResourceShape resource) {
        List<ValidationEvent> events = new ArrayList<>();
        Set<String> propertiesInOperations = new TreeSet<>();
        PropertyBindingIndex propertyBindingIndex = PropertyBindingIndex.of(model);

        processLifecycleOperationProperties(model,
                resource,
                "put",
                resource.getPut(),
                propertyBindingIndex,
                propertiesInOperations,
                events);
        processLifecycleOperationProperties(model,
                resource,
                "create",
                resource.getCreate(),
                propertyBindingIndex,
                propertiesInOperations,
                events);
        processLifecycleOperationProperties(model,
                resource,
                "read",
                resource.getRead(),
                propertyBindingIndex,
                propertiesInOperations,
                events);
        processLifecycleOperationProperties(model,
                resource,
                "update",
                resource.getUpdate(),
                propertyBindingIndex,
                propertiesInOperations,
                events);
        processLifecycleOperationProperties(model,
                resource,
                "delete",
                resource.getDelete(),
                propertyBindingIndex,
                propertiesInOperations,
                events);
        for (ShapeId operationId : resource.getOperations()) {
            processLifecycleOperationProperties(model,
                    resource,
                    operationId.getName(),
                    Optional.of(operationId),
                    propertyBindingIndex,
                    propertiesInOperations,
                    events);
        }

        Set<String> definedProperties = new HashSet<>(resource.getProperties().keySet());
        definedProperties.removeAll(propertiesInOperations);
        for (String propertyNotInLifecycleOp : definedProperties) {
            events.add(error(resource,
                    String.format("Resource property `%s` is not used in the input or output"
                            + " of create or an instance operation.", propertyNotInLifecycleOp)));
        }

        return events;
    }
Validates that resource properties are correctly used in resource-bound operations.
smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ResourceOperationInputOutputValidator.java