src/IdempotencyTokenMiddleware.php
public static function wrap(
        Service $service,
        callable $bytesGenerator = null
    ) {
        return function (callable $handler) use ($service, $bytesGenerator) {
            return new self($handler, $service, $bytesGenerator);
        };
    }
public static function wrap(
        Service $service,
        callable $bytesGenerator = null
    ) {
        return function (callable $handler) use ($service, $bytesGenerator) {
            return new self($handler, $service, $bytesGenerator);
        };
    }
public static function wrap ( Service $ service , callable $ bytesGenerator = null ) { return function ( callable $ handler ) use ( $ service , $ bytesGenerator ) { return new self ( $ handler , $ service , $ bytesGenerator ) ; } ; }
Creates a middleware that populates operation parameter
with trait 'idempotencyToken' enabled with a random UUIDv4

One of following functions needs to be available
in order to generate random bytes used for UUID
(SDK will attempt to utilize function in following order):
- random_bytes (requires PHP 7.0 or above)
- openssl_random_pseudo_bytes (requires 'openssl' module enabled)
- mcrypt_create_iv (requires 'mcrypt' module enabled)

You may also supply a custom bytes generator as an optional second
parameter.

@param \Aws\Api\Service $service
@param callable|null $bytesGenerator

@return callable
Creates a middleware that populates operation parameter with trait idempotencyToken enabled with a random UUIDv4