public static Endpoint fromNode(Node node) {
        ObjectNode objectNode = node.expectObjectNode();
        Builder builder = builder().sourceLocation(node);

        builder.url(Expression.fromNode(objectNode.expectMember(URL, "URL must be included in endpoint")));
        objectNode.expectNoAdditionalProperties(Arrays.asList(PROPERTIES, HEADERS, URL));

        objectNode.getObjectMember(PROPERTIES, properties -> {
            for (Map.Entry<StringNode, Node> member : properties.getMembers().entrySet()) {
                builder.putProperty(Identifier.of(member.getKey()), Literal.fromNode(member.getValue()));
            }
        });

        objectNode.getObjectMember(HEADERS, headers -> {
            for (Map.Entry<String, Node> header : headers.getStringMap().entrySet()) {
                builder.putHeader(header.getKey(),
                        header.getValue()
                                .expectArrayNode("header values should be an array")
                                .getElementsAs(Expression::fromNode));
            }
        });

        return builder.build();
    }
Constructs an {@link Endpoint} from a {@link Node}. Node must be an {@link ObjectNode}.

@param node the object node.
@return the node as an {@link Endpoint}.
smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/Endpoint.java