/** * Creates a DocumentServiceRequest with a resource. * * @param operation the operation type. * @param resourceType the resource type. * @param relativePath the relative URI path. * @param resource the resource of the request. * @param headers the request headers. * @return the created document service request. */ public static RxDocumentServiceRequest create(OperationType operation, ResourceType resourceType, String relativePath, Resource resource, Map<String, String> headers) { return new RxDocumentServiceRequest(operation, resourceType, relativePath, // TODO: this re-encodes, can we improve performance here? resource.toJson().getBytes(StandardCharsets.UTF_8), headers); }