Interface Link

  • All Superinterfaces:
    Constructible, Extensible, Reference<Link>


    public interface Link
    extends Constructible, Extensible, Reference<Link>
    Link

    The Link object represents a possible design-time link for a response. The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.

    For computing links, and providing instructions to execute them, a runtime expression is used for accessing values in an operation and using them as parameters while invoking the linked operation.

    A linked operation MUST be identified using either an operationRef or operationId. In the case of an operationId, it MUST be unique and resolved in the scope of the OAS document. Because of the potential for name clashes, the operationRef syntax is preferred for specifications with external references.

    See Also:
    OpenAPI Specification Link Object
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Link addParameter​(java.lang.String name, java.lang.Object parameter)
      Add a new parameter to the parameters property of this instance of Link.
      Link description​(java.lang.String description)
      Sets this Link's description property to the given string.
      java.lang.String getDescription​()
      Returns the description property from a Link instance.
      java.lang.String getOperationId​()
      Returns the operationId property for this instance of Link.
      java.lang.String getOperationRef​()
      Returns the operationRef property from a Link instance.
      java.util.Map<java.lang.String,java.lang.Object> getParameters​()
      Returns the parameters property from this instance of Link.
      java.lang.Object getRequestBody​()
      Returns the requestBody property from a Link instance.
      Server getServer​()
      Returns the server property from a Link instance.
      Link operationId​(java.lang.String operationId)
      Sets this Link's operationId property to the given string.
      Link operationRef​(java.lang.String operationRef)
      Sets this Link's operationRef property to the given string.
      Link parameters​(java.util.Map<java.lang.String,java.lang.Object> parameters)
      Sets this Link's parameters property to the given map and returns the modified Link instance.
      Link requestBody​(java.lang.Object requestBody)
      Sets this Link's requestBody property to the given object.
      Link server​(Server server)
      Sets this Link's server property to the given object.
      void setDescription​(java.lang.String description)
      Sets this Link's description property to the given string.
      void setOperationId​(java.lang.String operationId)
      Sets this Link's operationId property to the given string.
      void setOperationRef​(java.lang.String operationRef)
      Sets this Link's operationRef property to the given string.
      void setParameters​(java.util.Map<java.lang.String,java.lang.Object> parameters)
      Sets this Link's parameters property to the given map.
      void setRequestBody​(java.lang.Object requestBody)
      Sets this Link's requestBody property to the given object.
      void setServer​(Server server)
      Sets this Link's server property to the given object.
    • Method Detail

      • getServer

        Server getServer​()
        Returns the server property from a Link instance.
        Returns:
        a server object to be used by the target operation
      • setServer

        void setServer​(Server server)
        Sets this Link's server property to the given object.
        Parameters:
        server - a server object to be used by the target operation
      • server

        Link server​(Server server)
        Sets this Link's server property to the given object.
        Parameters:
        server - a server object to be used by the target operation
        Returns:
        the current Link instance
      • getOperationRef

        java.lang.String getOperationRef​()
        Returns the operationRef property from a Link instance.
        Returns:
        a relative or absolute reference to an OAS operation
      • setOperationRef

        void setOperationRef​(java.lang.String operationRef)
        Sets this Link's operationRef property to the given string. This field is mutually exclusive of the operationId field.
        Parameters:
        operationRef - a relative or absolute reference to an OAS operation
      • operationRef

        Link operationRef​(java.lang.String operationRef)
        Sets this Link's operationRef property to the given string. This field is mutually exclusive of the operationId field.
        Parameters:
        operationRef - a relative or absolute reference to an OAS operation
        Returns:
        the current Link instance
      • getRequestBody

        java.lang.Object getRequestBody​()
        Returns the requestBody property from a Link instance.
        Returns:
        a literal value or runtime expression to use as a request body when calling the target operation
      • setRequestBody

        void setRequestBody​(java.lang.Object requestBody)
        Sets this Link's requestBody property to the given object.
        Parameters:
        requestBody - a literal value or runtime expression to use as a request body when calling the target operation
      • requestBody

        Link requestBody​(java.lang.Object requestBody)
        Sets this Link's requestBody property to the given object.
        Parameters:
        requestBody - a literal value or runtime expression to use as a request body when calling the target operation
        Returns:
        the current Link instance
      • getOperationId

        java.lang.String getOperationId​()
        Returns the operationId property for this instance of Link.
        Returns:
        the name of an existing, resolvable OAS operation
      • setOperationId

        void setOperationId​(java.lang.String operationId)
        Sets this Link's operationId property to the given string. This field is mutually exclusive of the operationRef field.
        Parameters:
        operationId - the name of an existing, resolvable OAS operation
      • operationId

        Link operationId​(java.lang.String operationId)
        Sets this Link's operationId property to the given string. This field is mutually exclusive of the operationRef field.
        Parameters:
        operationId - the name of an existing, resolvable OAS operation
        Returns:
        the current Link instance
      • getParameters

        java.util.Map<java.lang.String,java.lang.Object> getParameters​()
        Returns the parameters property from this instance of Link. The key is the parameter name and the value is a constant or a runtime expression to be passed to the linked operation.
        Returns:
        a map representing parameters to pass to this link's operation
      • setParameters

        void setParameters​(java.util.Map<java.lang.String,java.lang.Object> parameters)
        Sets this Link's parameters property to the given map.
        Parameters:
        parameters - a map representing parameters to pass to this link's operation as specified with operationId or identified via operationRef
      • parameters

        Link parameters​(java.util.Map<java.lang.String,java.lang.Object> parameters)
        Sets this Link's parameters property to the given map and returns the modified Link instance.
        Parameters:
        parameters - a map representing parameters to pass to this link's operation as specified with operationId or identified via operationRef
        Returns:
        current link instance
      • addParameter

        Link addParameter​(java.lang.String name,
                          java.lang.Object parameter)
        Add a new parameter to the parameters property of this instance of Link.
        Parameters:
        name - The name of the parameter. Can be qualified using the parameter location [{in}.]{name} for operations that use the same parameter name in different locations (e.g. path.id).
        parameter - a constant or an expression to be evaluated at runtime and passed to the linked operation
        Returns:
        the current Link instance
      • getDescription

        java.lang.String getDescription​()
        Returns the description property from a Link instance.
        Returns:
        a description of the link
      • setDescription

        void setDescription​(java.lang.String description)
        Sets this Link's description property to the given string.
        Parameters:
        description - a description of the link
      • description

        Link description​(java.lang.String description)
        Sets this Link's description property to the given string.
        Parameters:
        description - a description of the link
        Returns:
        the current Link instance