package jetbrains.mps.make.script;

/*Generated by MPS */

import jetbrains.mps.annotations.GeneratedClass;
import jetbrains.mps.make.resources.IResource;

@GeneratedClass(node = "r:9e5578e0-37f0-4c9b-a301-771bcb453678(jetbrains.mps.make.script)/1291978361072214397", model = "r:9e5578e0-37f0-4c9b-a301-771bcb453678(jetbrains.mps.make.script)")
public interface IResult {
  default String message() {
    // since 2023.2
    return "";
  }
  boolean isSucessful();
  Iterable<IResource> output();

  class SUCCESS implements IResult {
    private final Iterable<IResource> output;
    private final String message;

    public SUCCESS(Iterable<IResource> output) {
      this("", output);
    }
    public SUCCESS(String message, Iterable<IResource> output) {
      this.message = message;
      this.output = output;
    }
    @Override
    public boolean isSucessful() {
      return true;
    }
    @Override
    public Iterable<IResource> output() {
      return output;
    }
    @Override
    public String message() {
      return message;
    }
  }

  class FAILURE implements IResult {
    private final Iterable<IResource> output;
    private final String message;

    public FAILURE(Iterable<IResource> output) {
      this("", output);
    }
    public FAILURE(String message, Iterable<IResource> output) {
      this.message = message;
      this.output = output;
    }
    @Override
    public boolean isSucessful() {
      return false;
    }
    @Override
    public Iterable<IResource> output() {
      return output;
    }
    @Override
    public String message() {
      return message;
    }
  }
}
