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

io.serverlessworkflow.api.functions.FunctionDefinition Maven / Gradle / Ivy


package io.serverlessworkflow.api.functions;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
    "name",
    "operation",
    "type",
    "authRef",
    "metadata"
})
@Generated("jsonschema2pojo")
public class FunctionDefinition implements Serializable
{

    /**
     * Function unique name
     * (Required)
     * 
     */
    @JsonProperty("name")
    @JsonPropertyDescription("Function unique name")
    @Size(min = 1)
    @NotNull
    private java.lang.String name;
    /**
     * If type is `rest`, #. If type is `rpc`, ##. If type is `expression`, defines the workflow expression.
     * 
     */
    @JsonProperty("operation")
    @JsonPropertyDescription("If type is `rest`, #. If type is `rpc`, ##. If type is `expression`, defines the workflow expression.")
    @Size(min = 1)
    private java.lang.String operation;
    /**
     * Defines the function type. Is either `rest`, `asyncapi, `rpc`, `graphql`, `odata`, `expression`, or `custom`. Default is `rest`
     * 
     */
    @JsonProperty("type")
    @JsonPropertyDescription("Defines the function type. Is either `rest`, `asyncapi, `rpc`, `graphql`, `odata`, `expression`, or `custom`. Default is `rest`")
    private FunctionDefinition.Type type = FunctionDefinition.Type.fromValue("rest");
    /**
     * References an auth definition name to be used to access to resource defined in the operation parameter
     * 
     */
    @JsonProperty("authRef")
    @JsonPropertyDescription("References an auth definition name to be used to access to resource defined in the operation parameter")
    @Size(min = 1)
    private java.lang.String authRef;
    /**
     * Metadata
     * 
     */
    @JsonProperty("metadata")
    @JsonPropertyDescription("Metadata")
    @Valid
    private Map metadata;
    private final static long serialVersionUID = -4399523015915799496L;

    /**
     * No args constructor for use in serialization
     * 
     */
    public FunctionDefinition() {
    }

    /**
     * 
     * @param name
     */
    public FunctionDefinition(java.lang.String name) {
        super();
        this.name = name;
    }

    /**
     * Function unique name
     * (Required)
     * 
     */
    @JsonProperty("name")
    public java.lang.String getName() {
        return name;
    }

    /**
     * Function unique name
     * (Required)
     * 
     */
    @JsonProperty("name")
    public void setName(java.lang.String name) {
        this.name = name;
    }

    public FunctionDefinition withName(java.lang.String name) {
        this.name = name;
        return this;
    }

    /**
     * If type is `rest`, #. If type is `rpc`, ##. If type is `expression`, defines the workflow expression.
     * 
     */
    @JsonProperty("operation")
    public java.lang.String getOperation() {
        return operation;
    }

    /**
     * If type is `rest`, #. If type is `rpc`, ##. If type is `expression`, defines the workflow expression.
     * 
     */
    @JsonProperty("operation")
    public void setOperation(java.lang.String operation) {
        this.operation = operation;
    }

    public FunctionDefinition withOperation(java.lang.String operation) {
        this.operation = operation;
        return this;
    }

    /**
     * Defines the function type. Is either `rest`, `asyncapi, `rpc`, `graphql`, `odata`, `expression`, or `custom`. Default is `rest`
     * 
     */
    @JsonProperty("type")
    public FunctionDefinition.Type getType() {
        return type;
    }

    /**
     * Defines the function type. Is either `rest`, `asyncapi, `rpc`, `graphql`, `odata`, `expression`, or `custom`. Default is `rest`
     * 
     */
    @JsonProperty("type")
    public void setType(FunctionDefinition.Type type) {
        this.type = type;
    }

    public FunctionDefinition withType(FunctionDefinition.Type type) {
        this.type = type;
        return this;
    }

    /**
     * References an auth definition name to be used to access to resource defined in the operation parameter
     * 
     */
    @JsonProperty("authRef")
    public java.lang.String getAuthRef() {
        return authRef;
    }

    /**
     * References an auth definition name to be used to access to resource defined in the operation parameter
     * 
     */
    @JsonProperty("authRef")
    public void setAuthRef(java.lang.String authRef) {
        this.authRef = authRef;
    }

    public FunctionDefinition withAuthRef(java.lang.String authRef) {
        this.authRef = authRef;
        return this;
    }

    /**
     * Metadata
     * 
     */
    @JsonProperty("metadata")
    public Map getMetadata() {
        return metadata;
    }

    /**
     * Metadata
     * 
     */
    @JsonProperty("metadata")
    public void setMetadata(Map metadata) {
        this.metadata = metadata;
    }

    public FunctionDefinition withMetadata(Map metadata) {
        this.metadata = metadata;
        return this;
    }


    /**
     * Defines the function type. Is either `rest`, `asyncapi, `rpc`, `graphql`, `odata`, `expression`, or `custom`. Default is `rest`
     * 
     */
    @Generated("jsonschema2pojo")
    public enum Type {

        REST("rest"),
        ASYNCAPI("asyncapi"),
        RPC("rpc"),
        GRAPHQL("graphql"),
        ODATA("odata"),
        EXPRESSION("expression"),
        CUSTOM("custom");
        private final java.lang.String value;
        private final static Map CONSTANTS = new HashMap();

        static {
            for (FunctionDefinition.Type c: values()) {
                CONSTANTS.put(c.value, c);
            }
        }

        Type(java.lang.String value) {
            this.value = value;
        }

        @Override
        public java.lang.String toString() {
            return this.value;
        }

        @JsonValue
        public java.lang.String value() {
            return this.value;
        }

        @JsonCreator
        public static FunctionDefinition.Type fromValue(java.lang.String value) {
            FunctionDefinition.Type constant = CONSTANTS.get(value);
            if (constant == null) {
                throw new IllegalArgumentException(value);
            } else {
                return constant;
            }
        }

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy