Class ApiCall<Self>

java.lang.Object
de.xima.fc.api.rest.pub.client.form.ApiCall<Self>
Type Parameters:
Self - The sub type that extends this call.
Direct Known Subclasses:
EndpointCategoryCall

@Generated("de.xima.openapi.codegen.java_jaxrs.XimaJavaJaxrsGenerator") public abstract class ApiCall<Self> extends Object
Represents a general API call to an endpoint. This instance is mutable and not thread-safe and should be used only for a single API call. You can modify the request before it's sent, but note that this is a low-level operation and may result in unexpected errors.
  • Field Details

  • Constructor Details

    • ApiCall

      public ApiCall()
  • Method Details

    • queryParams

      public List<Pair> queryParams()
      Returns:
      The query parameters to set on the request.
    • queryParams

      public Self queryParams(List<Pair> queryParams)
      Parameters:
      queryParams - The query parameters to set on the request.
      Returns:
      This instance for chaining method calls.
    • queryParam

      public Self queryParam(Pair queryNameValuePair)
      Add a query parameter to the existing parameters.
      Parameters:
      queryNameValuePair - Name and value of a param.
      Returns:
      This instance for chaining method calls.
    • headerParams

      public Map<String,String> headerParams()
      Returns:
      The header parameters to set on the request.
    • headerParams

      public Self headerParams(Map<String,String> headerParams)
      Parameters:
      headerParams - The header parameters to set on thr equest.
      Returns:
      This instance for chaining method calls.
    • headerParam

      public Self headerParam(String name, String value)
      Add a header parameter to the existing parameters. If a parameter with the name exists already, it is overwritten.
      Parameters:
      name - Name of a param.
      value - Value of the param.
      Returns:
      This instance for chaining method calls.
    • cookieParams

      public Map<String,String> cookieParams()
      Returns:
      The cookie parameters to set on the request.
    • cookieParams

      public Self cookieParams(Map<String,String> cookieParams)
      Parameters:
      cookieParams - The header parameters to set on the request.
      Returns:
      This instance for chaining method calls.
    • cookieParam

      public Self cookieParam(String name, String value)
      Add a cookie parameter to the existing parameters. If a parameter with the name exists already, it is overwritten.
      Parameters:
      name - Name of a param.
      value - Value of the param.
      Returns:
      This instance for chaining method calls.
    • body

      public RequestBody body()
      Returns:
      The body content to send with the request.
    • body

      public Self body(RequestBody body)
      Parameters:
      body - The body content to send with the request.
      Returns:
      This instance for chaining method calls.
    • body

      public Self body(Object body, String contentType)
      Parameters:
      body - The body content to send with the request.
      contentType - The content type of the request body.
      Returns:
      This instance for chaining method calls.
    • path

      public String path()
      Returns:
      The sub path of the endpoint URL.
    • path

      public Self path(String path)
      Parameters:
      path - The sub path of the endpoint URL.
      Returns:
      This instance for chaining method calls.
    • accept

      public String accept()
      Returns:
      The request's Accept header
    • accept

      public Self accept(String accept)
      Parameters:
      accept - The request's Accept header
      Returns:
      This instance for chaining method calls.
    • method

      public String method()
      Returns:
      The request method, one of "GET", "POST", "PUT", "HEAD" and "DELETE"
    • method

      public Self method(String method)
      Parameters:
      method - The request method, one of "GET", "POST", "PUT", "HEAD" and "DELETE"
      Returns:
      This instance for chaining method calls.
    • authNames

      public String[] authNames()
      Returns:
      The authentications to apply.
    • authNames

      public Self authNames(String[] authNames)
      Parameters:
      authNames - The authentications to apply.
      Returns:
      This instance for chaining method calls.
    • apiCallInterceptor

      public ApiCallInterceptor apiCallInterceptor()
      Returns:
      An optional interceptor to apply during the API call. Applied after the interceptor from the client.
    • apiCallInterceptor

      public Self apiCallInterceptor(ApiCallInterceptor apiCallInterceptor)
      Parameters:
      apiCallInterceptor - An optional interceptor to apply during the API call. Applied after the interceptor from the client.
      Returns:
      This instance for chaining method calls.
    • returnTypes

      public Map<Integer, ResponseTypeInfo> returnTypes()
      Returns:
      The return type into which to deserialize the response
    • returnTypes

      public Self returnTypes(Map<Integer, ResponseTypeInfo> returnTypes)
      Parameters:
      returnTypes - The return type into which to deserialize the response
      Returns:
      This instance for chaining method calls.
    • authentications

      public List<Authentication> authentications()
      Returns:
      Additional authentications that should be applied.
    • authentications

      public Self authentications(List<Authentication> authentications)
      Parameters:
      authentications - Additional authentications that should be applied.
      Returns:
      This instance for chaining method calls.
    • authentication

      public Self authentication(Authentication authentication)
      Adds an authentication to the existing local authentications.
      Parameters:
      authentication - An additional authentication that should be applied.
      Returns:
      This instance for chaining method calls.
    • properties

      public Map<String,Object> properties()
      Gets the properties in the context of a request. The properties are available for the lifetime of the request, applied to the JAX RS invocation.
      Returns:
      All current properties.
    • properties

      public Self properties(Map<String,Object> properties)
      Sets the properties in the context of a request. The properties are available for the lifetime of the request, applied to the JAX RS invocation.
      Parameters:
      properties - Properties to set. These will overwrite all existing properties.
      Returns:
      This instance for chaining method calls.
    • property

      public Self property(String name, Object value)
      Set a new property in the context of a request. The properties are available for the lifetime of the request, applied to the JAX RS invocation.
      Parameters:
      name - Name of the property.
      value - New value of the property.
      Returns:
      This instance for chaining method calls.
    • self

      protected abstract Self self()