Class RequestOptions


  • public class RequestOptions
    extends Object
    Container for optional HTTP headers that can be included in API requests. These options can be used to specify headers such as the Idempotency-Key, WWW-Authenticate or other custom headers.
    • Constructor Detail

      • RequestOptions

        public RequestOptions()
    • Method Detail

      • idempotencyKey

        public RequestOptions idempotencyKey​(String idempotencyKey)
        Set the Idempotency-Key header for the request.
        Parameters:
        idempotencyKey - The idempotency key.
        Returns:
        This RequestOptions instance.
      • requestedVerificationCodeHeader

        public RequestOptions requestedVerificationCodeHeader​(String requestedVerificationCodeHeader)
        Set the x-requested-verification-code header for the request.
        Parameters:
        requestedVerificationCodeHeader - The requested verification code.
        Returns:
        This RequestOptions instance.
      • wwwAuthenticateHeader

        public RequestOptions wwwAuthenticateHeader​(String wwwAuthenticateHeader)
        Set the WWW-Authenticate header for the request.
        Parameters:
        wwwAuthenticateHeader - The WWW-Authenticate header value.
        Returns:
        This RequestOptions instance.
      • additionalServiceHeaders

        public RequestOptions additionalServiceHeaders​(HashMap<String,​String> additionalServiceHeaders)
        Set additional headers for the request.
        Parameters:
        additionalServiceHeaders - A map of additional headers.
        Returns:
        This RequestOptions instance.
      • addAdditionalServiceHeader

        public RequestOptions addAdditionalServiceHeader​(String key,
                                                         String value)
        Add an additional header to the request.
        Parameters:
        key - The key of the header.
        value - The value of the header.
        Returns:
        This RequestOptions instance.
      • getIdempotencyKey

        public String getIdempotencyKey()
        Get the value of the Idempotency-Key header.
        Returns:
        The idempotency key.
      • setIdempotencyKey

        public void setIdempotencyKey​(String idempotencyKey)
        Set the Idempotency-Key header for the request.
        Parameters:
        idempotencyKey - The idempotency key.
      • getRequestedVerificationCodeHeader

        public String getRequestedVerificationCodeHeader()
        Get the value of the x-requested-verification-code header.
        Returns:
        The requested verification code.
      • setRequestedVerificationCodeHeader

        public void setRequestedVerificationCodeHeader​(String requestedVerificationCodeHeader)
        Set the x-requested-verification-code header for the request.
        Parameters:
        requestedVerificationCodeHeader - The requested verification code.
      • getAdditionalServiceHeaders

        public HashMap<String,​String> getAdditionalServiceHeaders()
        Get additional headers for the request.
        Returns:
        A map of additional headers.
      • setAdditionalServiceHeaders

        public void setAdditionalServiceHeaders​(HashMap<String,​String> additionalServiceHeaders)
        Set additional headers for the request.
        Parameters:
        additionalServiceHeaders - A map of additional headers.
      • getWwwAuthenticateHeader

        public String getWwwAuthenticateHeader()
        Get the value of the WWW-Authenticate header.
        Returns:
        The WWW-Authenticate header value.
      • setWwwAuthenticateHeader

        public void setWwwAuthenticateHeader​(String wwwAuthenticateHeader)
        Set the WWW-Authenticate header for the request.
        Parameters:
        wwwAuthenticateHeader - The WWW-Authenticate header value.