All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.projectodd.openwhisk.model.ActionExec Maven / Gradle / Ivy

There is a newer version: 0.8
Show newest version
/*
 * OpenWhisk REST API
 * API for OpenWhisk
 *
 * OpenAPI spec version: 0.1.0
 * 
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */


package org.projectodd.openwhisk.model;

import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * definition of the action, such as javascript code or the name of a container
 */
@ApiModel(description = "definition of the action, such as javascript code or the name of a container")

public class ActionExec {
  /**
   * the type of action
   */
  public enum KindEnum {
    NODEJS_6("nodejs:6"),
    
    NODEJS_8("nodejs:8"),
    
    PYTHON_2("python:2"),
    
    PYTHON_3("python:3"),
    
    SWIFT_3_1_1("swift:3.1.1"),
    
    JAVA("java"),
    
    BLACKBOX("blackbox");

    private String value;

    KindEnum(String value) {
      this.value = value;
    }

    @JsonValue
    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    @JsonCreator
    public static KindEnum fromValue(String text) {
      for (KindEnum b : KindEnum.values()) {
        if (String.valueOf(b.value).equals(text)) {
          return b;
        }
      }
      return null;
    }
  }

  @JsonProperty("kind")
  private KindEnum kind = null;

  @JsonProperty("code")
  private String code = null;

  @JsonProperty("image")
  private String image = null;

  @JsonProperty("init")
  private String init = null;

  @JsonProperty("main")
  private String main = null;

  public ActionExec kind(KindEnum kind) {
    this.kind = kind;
    return this;
  }

   /**
   * the type of action
   * @return kind
  **/
  @ApiModelProperty(required = true, value = "the type of action")
  public KindEnum getKind() {
    return kind;
  }

  public void setKind(KindEnum kind) {
    this.kind = kind;
  }

  public ActionExec code(String code) {
    this.code = code;
    return this;
  }

   /**
   * The code to execute when kind is not 'blackbox'. For kinds like 'java', this is the path to the file to upload
   * @return code
  **/
  @ApiModelProperty(value = "The code to execute when kind is not 'blackbox'. For kinds like 'java', this is the path to the file to upload")
  public String getCode() {
    return code;
  }

  public void setCode(String code) {
    this.code = code;
  }

  public ActionExec image(String image) {
    this.image = image;
    return this;
  }

   /**
   * container image name when kind is 'blackbox'
   * @return image
  **/
  @ApiModelProperty(value = "container image name when kind is 'blackbox'")
  public String getImage() {
    return image;
  }

  public void setImage(String image) {
    this.image = image;
  }

  public ActionExec init(String init) {
    this.init = init;
    return this;
  }

   /**
   * optional zipfile reference when code kind is 'nodejs'
   * @return init
  **/
  @ApiModelProperty(value = "optional zipfile reference when code kind is 'nodejs'")
  public String getInit() {
    return init;
  }

  public void setInit(String init) {
    this.init = init;
  }

  public ActionExec main(String main) {
    this.main = main;
    return this;
  }

   /**
   * optional main class when code kind is 'java'
   * @return main
  **/
  @ApiModelProperty(value = "optional main class when code kind is 'java'")
  public String getMain() {
    return main;
  }

  public void setMain(String main) {
    this.main = main;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ActionExec actionExec = (ActionExec) o;
    return Objects.equals(this.kind, actionExec.kind) &&
        Objects.equals(this.code, actionExec.code) &&
        Objects.equals(this.image, actionExec.image) &&
        Objects.equals(this.init, actionExec.init) &&
        Objects.equals(this.main, actionExec.main);
  }

  @Override
  public int hashCode() {
    return Objects.hash(kind, code, image, init, main);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ActionExec {\n");
    
    sb.append("    kind: ").append(toIndentedString(kind)).append("\n");
    sb.append("    code: ").append(toIndentedString(code)).append("\n");
    sb.append("    image: ").append(toIndentedString(image)).append("\n");
    sb.append("    init: ").append(toIndentedString(init)).append("\n");
    sb.append("    main: ").append(toIndentedString(main)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy