/home/techb158/ileadtechnology.com/vendor/aws/aws-sdk-php/src/Sts
Edit: /home/techb158/ileadtechnology.com/vendor/aws/aws-sdk-php/src/Sts/StsClient.php (4332B)
addBuiltIns($args);
parent::__construct($args);
}
/**
* Creates credentials from the result of an STS operations
*
* @param Result $result Result of an STS operation
*
* @return Credentials
* @throws \InvalidArgumentException if the result contains no credentials
*/
public function createCredentials(Result $result)
{
if (!$result->hasKey('Credentials')) {
throw new \InvalidArgumentException('Result contains no credentials');
}
$c = $result['Credentials'];
return new Credentials(
$c['AccessKeyId'],
$c['SecretAccessKey'],
isset($c['SessionToken']) ? $c['SessionToken'] : null,
isset($c['Expiration']) && $c['Expiration'] instanceof \DateTimeInterface
? (int) $c['Expiration']->format('U')
: null
);
}
/**
* Adds service-specific client built-in value
*
* @return void
*/
private function addBuiltIns($args)
{
$key = 'AWS::STS::UseGlobalEndpoint';
$result = $args['sts_regional_endpoints'] instanceof \Closure ?
$args['sts_regional_endpoints']()->wait() : $args['sts_regional_endpoints'];
if (is_string($result)) {
if ($result === 'regional') {
$value = false;
} else if ($result === 'legacy') {
$value = true;
} else {
return;
}
} else {
if ($result->getEndpointsType() === 'regional') {
$value = false;
} else {
$value = true;
}
}
$this->clientBuiltIns[$key] = $value;
}
}