@Override
    public Node toNode() {
        NodeMapper mapper = new NodeMapper();
        ObjectNode.Builder builder = Node.objectNodeBuilder();

        // This ordering is hand maintained to produce a similar output
        // to those of the resource schemas in CloudFormation documentation,
        // as the NodeMapper does not have a mechanism to order members.
        builder.withMember("typeName", typeName);
        builder.withMember("description", description);

        getSourceUrl().ifPresent(sourceUrl -> builder.withMember("sourceUrl", sourceUrl));
        getDocumentationUrl().ifPresent(documentationUrl -> builder.withMember("documentationUrl", documentationUrl));

        if (!definitions.isEmpty()) {
            builder.withMember("definitions", mapper.serialize(definitions));
        }

        builder.withMember("properties", mapper.serialize(properties));

        if (!required.isEmpty()) {
            builder.withMember("required", mapper.serialize(required));
        }
        if (!readOnlyProperties.isEmpty()) {
            builder.withMember("readOnlyProperties", mapper.serialize(readOnlyProperties));
        }
        if (!writeOnlyProperties.isEmpty()) {
            builder.withMember("writeOnlyProperties", mapper.serialize(writeOnlyProperties));
        }
        if (!createOnlyProperties.isEmpty()) {
            builder.withMember("createOnlyProperties", mapper.serialize(createOnlyProperties));
        }
        if (!deprecatedProperties.isEmpty()) {
            builder.withMember("deprecatedProperties", mapper.serialize(deprecatedProperties));
        }
        if (!primaryIdentifier.isEmpty()) {
            builder.withMember("primaryIdentifier", mapper.serialize(primaryIdentifier));
        }
        if (!additionalIdentifiers.isEmpty()) {
            builder.withMember("additionalIdentifiers", mapper.serialize(additionalIdentifiers));
        }
        if (!handlers.isEmpty()) {
            builder.withMember("handlers", mapper.serialize(handlers));
        }
        if (!remotes.isEmpty()) {
            builder.withMember("remotes", mapper.serialize(remotes));
        }
        if (tagging != null) {
            builder.withMember("tagging", mapper.serialize(tagging));
        }
        if (additionalProperties != null) {
            builder.withMember("additionalProperties", mapper.serialize(additionalProperties));
        }

        return builder.build();
    }
Data class representing a CloudFormation Resource Schema.

@see <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html#resource-type-schema-syntax">Resource Type Schema</a>
@see <a href="https://github.com/aws-cloudformation/cloudformation-cli/blob/master/src/rpdk/core/data/schema/provider.definition.schema.v1.jsonL252">Resource Type JSON Schema</a>
smithy-aws-cloudformation/src/main/java/software/amazon/smithy/aws/cloudformation/schema/model/ResourceSchema.java