Skip to content

Commit

Permalink
Removing Writeable from Template (#392)
Browse files Browse the repository at this point in the history
Removing writeable from template

Signed-off-by: Joshua Palis <[email protected]>
  • Loading branch information
joshpalis committed Jan 9, 2024
1 parent a6fb532 commit 815a74e
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions src/main/java/org/opensearch/flowframework/model/Template.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import org.opensearch.common.xcontent.json.JsonXContent;
import org.opensearch.common.xcontent.yaml.YamlXContent;
import org.opensearch.commons.authuser.User;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.common.io.stream.Writeable;
import org.opensearch.core.xcontent.NamedXContentRegistry;
import org.opensearch.core.xcontent.ToXContentObject;
import org.opensearch.core.xcontent.XContentBuilder;
Expand All @@ -37,7 +35,7 @@
/**
* The Template is the central data structure which configures workflows. This object is used to parse JSON communicated via REST API.
*/
public class Template implements ToXContentObject, Writeable {
public class Template implements ToXContentObject {

/** The template field name for template workflows */
public static final String WORKFLOWS_FIELD = "workflows";
Expand Down Expand Up @@ -247,23 +245,6 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
return xContentBuilder.endObject();
}

// TODO: fix writeable when implementing get workflow API
@Override
public void writeTo(StreamOutput output) throws IOException {
output.writeString(name);
output.writeOptionalString(description);
output.writeString(useCase);
output.writeVersion(templateVersion);
// output.writeList((List<? extends Writeable>) compatibilityVersion);
output.writeMapWithConsistentOrder(workflows);
if (user != null) {
output.writeBoolean(true); // user exists
user.writeTo(output);
} else {
output.writeBoolean(false); // user does not exist
}
}

/**
* Parse raw xContent into a Template instance.
*
Expand Down

0 comments on commit 815a74e

Please sign in to comment.