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

org.zalando.riptide.idempotency.IdempotencyKeyIdempotencyDetector Maven / Gradle / Ivy

There is a newer version: 4.1.0
Show newest version
package org.zalando.riptide.idempotency;

import org.apiguardian.api.API;
import org.zalando.riptide.RequestArguments;

import static org.apiguardian.api.API.Status.EXPERIMENTAL;

/**
 * @see Stripe API: Idempotent Requests
 */
@API(status = EXPERIMENTAL)
public final class IdempotencyKeyIdempotencyDetector implements IdempotencyDetector {

    @Override
    public Decision test(final RequestArguments arguments, final Test root) {
        return arguments.getHeaders().containsKey("Idempotency-Key") ?
                Decision.ACCEPT : Decision.NEUTRAL;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy