X7ROOT File Manager
Current Path:
/home/gfecatvj/sites/restate/vendor/aws/aws-sdk-php/src
home
/
gfecatvj
/
sites
/
restate
/
vendor
/
aws
/
aws-sdk-php
/
src
/
📁
..
📁
ACMPCA
📄
AbstractConfigurationProvider.php
(4.46 KB)
📁
AccessAnalyzer
📁
Acm
📁
AlexaForBusiness
📁
Amplify
📁
Api
📁
ApiGateway
📁
ApiGatewayManagementApi
📁
ApiGatewayV2
📁
AppConfig
📁
AppMesh
📁
AppSync
📁
ApplicationAutoScaling
📁
ApplicationDiscoveryService
📁
ApplicationInsights
📁
Appstream
📁
Arn
📁
Athena
📁
AugmentedAIRuntime
📁
AutoScaling
📁
AutoScalingPlans
📄
AwsClient.php
(17.21 KB)
📄
AwsClientInterface.php
(5.4 KB)
📄
AwsClientTrait.php
(2.67 KB)
📁
Backup
📁
Batch
📁
Budgets
📄
CacheInterface.php
(755 B)
📁
Chime
📄
ClientResolver.php
(34.92 KB)
📁
ClientSideMonitoring
📁
Cloud9
📁
CloudDirectory
📁
CloudFormation
📁
CloudFront
📁
CloudHSMV2
📁
CloudHsm
📁
CloudSearch
📁
CloudSearchDomain
📁
CloudTrail
📁
CloudWatch
📁
CloudWatchEvents
📁
CloudWatchLogs
📁
CodeArtifact
📁
CodeBuild
📁
CodeCommit
📁
CodeDeploy
📁
CodeGuruProfiler
📁
CodeGuruReviewer
📁
CodePipeline
📁
CodeStar
📁
CodeStarNotifications
📁
CodeStarconnections
📁
CognitoIdentity
📁
CognitoIdentityProvider
📁
CognitoSync
📄
Command.php
(1.39 KB)
📄
CommandInterface.php
(946 B)
📄
CommandPool.php
(5.2 KB)
📁
Comprehend
📁
ComprehendMedical
📁
ComputeOptimizer
📁
ConfigService
📄
ConfigurationProviderInterface.php
(246 B)
📁
Connect
📁
ConnectParticipant
📁
CostExplorer
📁
CostandUsageReportService
📁
Credentials
📁
Crypto
📁
DAX
📁
DLM
📁
DataExchange
📁
DataPipeline
📁
DataSync
📁
DatabaseMigrationService
📁
Detective
📁
DeviceFarm
📁
DirectConnect
📁
DirectoryService
📁
DocDB
📄
DoctrineCacheAdapter.php
(989 B)
📁
DynamoDb
📁
DynamoDbStreams
📁
EBS
📁
EC2InstanceConnect
📁
EKS
📁
Ec2
📁
Ecr
📁
Ecs
📁
Efs
📁
ElastiCache
📁
ElasticBeanstalk
📁
ElasticInference
📁
ElasticLoadBalancing
📁
ElasticLoadBalancingV2
📁
ElasticTranscoder
📁
ElasticsearchService
📁
Emr
📁
Endpoint
📁
EndpointDiscovery
📄
EndpointParameterMiddleware.php
(2.73 KB)
📁
EventBridge
📁
Exception
📁
FMS
📁
FSx
📁
Firehose
📁
ForecastQueryService
📁
ForecastService
📁
FraudDetector
📁
GameLift
📁
Glacier
📁
GlobalAccelerator
📁
Glue
📁
Greengrass
📁
GroundStation
📁
GuardDuty
📁
Handler
📄
HandlerList.php
(13.18 KB)
📄
HasDataTrait.php
(1.11 KB)
📄
HasMonitoringEventsTrait.php
(869 B)
📄
HashInterface.php
(531 B)
📄
HashingStream.php
(1.5 KB)
📁
Health
📄
History.php
(3.81 KB)
📁
Honeycode
📁
IVS
📁
Iam
📄
IdempotencyTokenMiddleware.php
(3.69 KB)
📁
ImportExport
📁
Inspector
📁
IoT1ClickDevicesService
📁
IoT1ClickProjects
📁
IoTAnalytics
📁
IoTEvents
📁
IoTEventsData
📁
IoTJobsDataPlane
📁
IoTSecureTunneling
📁
IoTSiteWise
📁
IoTThingsGraph
📁
Iot
📁
IotDataPlane
📄
JsonCompiler.php
(478 B)
📁
Kafka
📁
Kinesis
📁
KinesisAnalytics
📁
KinesisAnalyticsV2
📁
KinesisVideo
📁
KinesisVideoArchivedMedia
📁
KinesisVideoMedia
📁
KinesisVideoSignalingChannels
📁
Kms
📁
LakeFormation
📁
Lambda
📁
LexModelBuildingService
📁
LexRuntimeService
📁
LicenseManager
📁
Lightsail
📄
LruArrayCache.php
(2.16 KB)
📁
MQ
📁
MTurk
📁
MachineLearning
📁
Macie
📁
Macie2
📁
ManagedBlockchain
📁
MarketplaceCatalog
📁
MarketplaceCommerceAnalytics
📁
MarketplaceEntitlementService
📁
MarketplaceMetering
📁
MediaConnect
📁
MediaConvert
📁
MediaLive
📁
MediaPackage
📁
MediaPackageVod
📁
MediaStore
📁
MediaStoreData
📁
MediaTailor
📄
Middleware.php
(12.76 KB)
📁
MigrationHub
📁
MigrationHubConfig
📁
Mobile
📄
MockHandler.php
(4.02 KB)
📄
MonitoringEventsInterface.php
(742 B)
📄
MultiRegionClient.php
(7.75 KB)
📁
Multipart
📁
Neptune
📁
NetworkManager
📁
OpsWorks
📁
OpsWorksCM
📁
Organizations
📁
Outposts
📁
PI
📁
Personalize
📁
PersonalizeEvents
📁
PersonalizeRuntime
📄
PhpHash.php
(1.81 KB)
📁
Pinpoint
📁
PinpointEmail
📁
PinpointSMSVoice
📁
Polly
📄
PresignUrlMiddleware.php
(3.28 KB)
📁
Pricing
📄
Psr16CacheAdapter.php
(572 B)
📄
PsrCacheAdapter.php
(742 B)
📁
QLDB
📁
QLDBSession
📁
QuickSight
📁
RAM
📁
RDSDataService
📁
Rds
📁
Redshift
📁
Rekognition
📁
ResourceGroups
📁
ResourceGroupsTaggingAPI
📄
ResponseContainerInterface.php
(246 B)
📄
Result.php
(1.14 KB)
📄
ResultInterface.php
(1.34 KB)
📄
ResultPaginator.php
(5.09 KB)
📁
Retry
📄
RetryMiddleware.php
(8.46 KB)
📄
RetryMiddlewareV2.php
(11.66 KB)
📁
RoboMaker
📁
Route53
📁
Route53Domains
📁
Route53Resolver
📁
S3
📁
S3Control
📁
SSO
📁
SSOOIDC
📁
SageMaker
📁
SageMakerRuntime
📁
SavingsPlans
📁
Schemas
📄
Sdk.php
(39.34 KB)
📁
SecretsManager
📁
SecurityHub
📁
ServerlessApplicationRepository
📁
ServiceCatalog
📁
ServiceDiscovery
📁
ServiceQuotas
📁
Ses
📁
SesV2
📁
Sfn
📁
Shield
📁
Signature
📁
Sms
📁
SnowBall
📁
Sns
📁
Sqs
📁
Ssm
📁
StorageGateway
📄
StreamRequestPayloadMiddleware.php
(2.57 KB)
📁
Sts
📁
Support
📁
Swf
📁
Synthetics
📁
Textract
📄
TraceMiddleware.php
(10.72 KB)
📁
TranscribeService
📁
Transfer
📁
Translate
📁
WAFV2
📁
Waf
📁
WafRegional
📄
Waiter.php
(8.32 KB)
📁
WorkDocs
📁
WorkLink
📁
WorkMail
📁
WorkMailMessageFlow
📁
WorkSpaces
📄
WrappedHttpHandler.php
(6.96 KB)
📁
XRay
📁
data
📄
functions.php
(12.93 KB)
📁
imagebuilder
📁
kendra
📁
signer
Editing: Waiter.php
<?php namespace Aws; use Aws\Exception\AwsException; use GuzzleHttp\Promise; use GuzzleHttp\Promise\PromisorInterface; use GuzzleHttp\Promise\RejectedPromise; /** * "Waiters" are associated with an AWS resource (e.g., EC2 instance), and poll * that resource and until it is in a particular state. * The Waiter object produces a promise that is either a.) resolved once the * waiting conditions are met, or b.) rejected if the waiting conditions cannot * be met or has exceeded the number of allowed attempts at meeting the * conditions. You can use waiters in a blocking or non-blocking way, depending * on whether you call wait() on the promise. * The configuration for the waiter must include information about the operation * and the conditions for wait completion. */ class Waiter implements PromisorInterface { /** @var AwsClientInterface Client used to execute each attempt. */ private $client; /** @var string Name of the waiter. */ private $name; /** @var array Params to use with each attempt operation. */ private $args; /** @var array Waiter configuration. */ private $config; /** @var array Default configuration options. */ private static $defaults = ['initDelay' => 0, 'before' => null]; /** @var array Required configuration options. */ private static $required = [ 'acceptors', 'delay', 'maxAttempts', 'operation', ]; /** * The array of configuration options include: * * - acceptors: (array) Array of acceptor options * - delay: (int) Number of seconds to delay between attempts * - maxAttempts: (int) Maximum number of attempts before failing * - operation: (string) Name of the API operation to use for polling * - before: (callable) Invoked before attempts. Accepts command and tries. * * @param AwsClientInterface $client Client used to execute commands. * @param string $name Waiter name. * @param array $args Command arguments. * @param array $config Waiter config that overrides defaults. * * @throws \InvalidArgumentException if the configuration is incomplete. */ public function __construct( AwsClientInterface $client, $name, array $args = [], array $config = [] ) { $this->client = $client; $this->name = $name; $this->args = $args; // Prepare and validate config. $this->config = $config + self::$defaults; foreach (self::$required as $key) { if (!isset($this->config[$key])) { throw new \InvalidArgumentException( 'The provided waiter configuration was incomplete.' ); } } if ($this->config['before'] && !is_callable($this->config['before'])) { throw new \InvalidArgumentException( 'The provided "before" callback is not callable.' ); } } public function promise() { return Promise\coroutine(function () { $name = $this->config['operation']; for ($state = 'retry', $attempt = 1; $state === 'retry'; $attempt++) { // Execute the operation. $args = $this->getArgsForAttempt($attempt); $command = $this->client->getCommand($name, $args); try { if ($this->config['before']) { $this->config['before']($command, $attempt); } $result = (yield $this->client->executeAsync($command)); } catch (AwsException $e) { $result = $e; } // Determine the waiter's state and what to do next. $state = $this->determineState($result); if ($state === 'success') { yield $command; } elseif ($state === 'failed') { $msg = "The {$this->name} waiter entered a failure state."; if ($result instanceof \Exception) { $msg .= ' Reason: ' . $result->getMessage(); } yield new RejectedPromise(new \RuntimeException($msg)); } elseif ($state === 'retry' && $attempt >= $this->config['maxAttempts'] ) { $state = 'failed'; yield new RejectedPromise(new \RuntimeException( "The {$this->name} waiter failed after attempt #{$attempt}." )); } } }); } /** * Gets the operation arguments for the attempt, including the delay. * * @param $attempt Number of the current attempt. * * @return mixed integer */ private function getArgsForAttempt($attempt) { $args = $this->args; // Determine the delay. $delay = ($attempt === 1) ? $this->config['initDelay'] : $this->config['delay']; if (is_callable($delay)) { $delay = $delay($attempt); } // Set the delay. (Note: handlers except delay in milliseconds.) if (!isset($args['@http'])) { $args['@http'] = []; } $args['@http']['delay'] = $delay * 1000; return $args; } /** * Determines the state of the waiter attempt, based on the result of * polling the resource. A waiter can have the state of "success", "failed", * or "retry". * * @param mixed $result * * @return string Will be "success", "failed", or "retry" */ private function determineState($result) { foreach ($this->config['acceptors'] as $acceptor) { $matcher = 'matches' . ucfirst($acceptor['matcher']); if ($this->{$matcher}($result, $acceptor)) { return $acceptor['state']; } } return $result instanceof \Exception ? 'failed' : 'retry'; } /** * @param Result $result Result or exception. * @param array $acceptor Acceptor configuration being checked. * * @return bool */ private function matchesPath($result, array $acceptor) { return !($result instanceof ResultInterface) ? false : $acceptor['expected'] == $result->search($acceptor['argument']); } /** * @param Result $result Result or exception. * @param array $acceptor Acceptor configuration being checked. * * @return bool */ private function matchesPathAll($result, array $acceptor) { if (!($result instanceof ResultInterface)) { return false; } $actuals = $result->search($acceptor['argument']) ?: []; foreach ($actuals as $actual) { if ($actual != $acceptor['expected']) { return false; } } return true; } /** * @param Result $result Result or exception. * @param array $acceptor Acceptor configuration being checked. * * @return bool */ private function matchesPathAny($result, array $acceptor) { if (!($result instanceof ResultInterface)) { return false; } $actuals = $result->search($acceptor['argument']) ?: []; return in_array($acceptor['expected'], $actuals); } /** * @param Result $result Result or exception. * @param array $acceptor Acceptor configuration being checked. * * @return bool */ private function matchesStatus($result, array $acceptor) { if ($result instanceof ResultInterface) { return $acceptor['expected'] == $result['@metadata']['statusCode']; } if ($result instanceof AwsException && $response = $result->getResponse()) { return $acceptor['expected'] == $response->getStatusCode(); } return false; } /** * @param Result $result Result or exception. * @param array $acceptor Acceptor configuration being checked. * * @return bool */ private function matchesError($result, array $acceptor) { if ($result instanceof AwsException) { return $result->isConnectionError() || $result->getAwsErrorCode() == $acceptor['expected']; } return false; } }
Upload File
Create Folder