Файл: sngine-v2.8/Script/includes/libs/AWS/Aws/DynamoDb/DynamoDbClient.php
Строк: 296
<?php
namespace AwsDynamoDb;
use AwsApiParserCrc32ValidatingParser;
use AwsAwsClient;
use AwsClientResolver;
use AwsExceptionAwsException;
use AwsHandlerList;
use AwsMiddleware;
use AwsRetryMiddleware;
use AwsRetryMiddlewareV2;
/**
* This client is used to interact with the **Amazon DynamoDB** service.
*
* @method AwsResult batchGetItem(array $args = [])
* @method GuzzleHttpPromisePromise batchGetItemAsync(array $args = [])
* @method AwsResult batchWriteItem(array $args = [])
* @method GuzzleHttpPromisePromise batchWriteItemAsync(array $args = [])
* @method AwsResult createTable(array $args = [])
* @method GuzzleHttpPromisePromise createTableAsync(array $args = [])
* @method AwsResult deleteItem(array $args = [])
* @method GuzzleHttpPromisePromise deleteItemAsync(array $args = [])
* @method AwsResult deleteTable(array $args = [])
* @method GuzzleHttpPromisePromise deleteTableAsync(array $args = [])
* @method AwsResult describeTable(array $args = [])
* @method GuzzleHttpPromisePromise describeTableAsync(array $args = [])
* @method AwsResult getItem(array $args = [])
* @method GuzzleHttpPromisePromise getItemAsync(array $args = [])
* @method AwsResult listTables(array $args = [])
* @method GuzzleHttpPromisePromise listTablesAsync(array $args = [])
* @method AwsResult putItem(array $args = [])
* @method GuzzleHttpPromisePromise putItemAsync(array $args = [])
* @method AwsResult query(array $args = [])
* @method GuzzleHttpPromisePromise queryAsync(array $args = [])
* @method AwsResult scan(array $args = [])
* @method GuzzleHttpPromisePromise scanAsync(array $args = [])
* @method AwsResult updateItem(array $args = [])
* @method GuzzleHttpPromisePromise updateItemAsync(array $args = [])
* @method AwsResult updateTable(array $args = [])
* @method GuzzleHttpPromisePromise updateTableAsync(array $args = [])
* @method AwsResult createBackup(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise createBackupAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult createGlobalTable(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise createGlobalTableAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult deleteBackup(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise deleteBackupAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult describeBackup(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise describeBackupAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult describeContinuousBackups(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise describeContinuousBackupsAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult describeContributorInsights(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise describeContributorInsightsAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult describeEndpoints(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise describeEndpointsAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult describeGlobalTable(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise describeGlobalTableAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult describeGlobalTableSettings(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise describeGlobalTableSettingsAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult describeLimits(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise describeLimitsAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult describeTableReplicaAutoScaling(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise describeTableReplicaAutoScalingAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult describeTimeToLive(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise describeTimeToLiveAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult listBackups(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise listBackupsAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult listContributorInsights(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise listContributorInsightsAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult listGlobalTables(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise listGlobalTablesAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult listTagsOfResource(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise listTagsOfResourceAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult restoreTableFromBackup(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise restoreTableFromBackupAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult restoreTableToPointInTime(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise restoreTableToPointInTimeAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult tagResource(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise tagResourceAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult transactGetItems(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise transactGetItemsAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult transactWriteItems(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise transactWriteItemsAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult untagResource(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise untagResourceAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult updateContinuousBackups(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise updateContinuousBackupsAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult updateContributorInsights(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise updateContributorInsightsAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult updateGlobalTable(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise updateGlobalTableAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult updateGlobalTableSettings(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise updateGlobalTableSettingsAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult updateTableReplicaAutoScaling(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise updateTableReplicaAutoScalingAsync(array $args = []) (supported in versions 2012-08-10)
* @method AwsResult updateTimeToLive(array $args = []) (supported in versions 2012-08-10)
* @method GuzzleHttpPromisePromise updateTimeToLiveAsync(array $args = []) (supported in versions 2012-08-10)
*/
class DynamoDbClient extends AwsClient
{
public static function getArguments()
{
$args = parent::getArguments();
$args['retries']['default'] = 10;
$args['retries']['fn'] = [__CLASS__, '_applyRetryConfig'];
$args['api_provider']['fn'] = [__CLASS__, '_applyApiProvider'];
return $args;
}
/**
* Convenience method for instantiating and registering the DynamoDB
* Session handler with this DynamoDB client object.
*
* @param array $config Array of options for the session handler factory
*
* @return SessionHandler
*/
public function registerSessionHandler(array $config = [])
{
$handler = SessionHandler::fromClient($this, $config);
$handler->register();
return $handler;
}
/** @internal */
public static function _applyRetryConfig($value, array &$args, HandlerList $list)
{
if ($value) {
$config = AwsRetryConfigurationProvider::unwrap($value);
if ($config->getMode() === 'legacy') {
$list->appendSign(
Middleware::retry(
RetryMiddleware::createDefaultDecider(
$config->getMaxAttempts() - 1,
['error_codes' => ['TransactionInProgressException']]
),
function ($retries) {
return $retries
? RetryMiddleware::exponentialDelay($retries) / 2
: 0;
},
isset($args['stats']['retries'])
? (bool)$args['stats']['retries']
: false
),
'retry'
);
} else {
$list->appendSign(
RetryMiddlewareV2::wrap(
$config,
[
'collect_stats' => $args['stats']['retries'],
'transient_error_codes' => ['TransactionInProgressException']
]
),
'retry'
);
}
}
}
/** @internal */
public static function _applyApiProvider($value, array &$args, HandlerList $list)
{
ClientResolver::_apply_api_provider($value, $args);
$args['parser'] = new Crc32ValidatingParser($args['parser']);
}
}