Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions aws/aws-sdk-php/src/AccessAnalyzer/AccessAnalyzerClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@
* @method \GuzzleHttp\Promise\Promise createAnalyzerAsync(array $args = [])
* @method \Aws\Result createArchiveRule(array $args = [])
* @method \GuzzleHttp\Promise\Promise createArchiveRuleAsync(array $args = [])
* @method \Aws\Result createServiceLinkedAnalyzer(array $args = [])
* @method \GuzzleHttp\Promise\Promise createServiceLinkedAnalyzerAsync(array $args = [])
* @method \Aws\Result deleteAnalyzer(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAnalyzerAsync(array $args = [])
* @method \Aws\Result deleteArchiveRule(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteArchiveRuleAsync(array $args = [])
* @method \Aws\Result deleteServiceLinkedAnalyzer(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteServiceLinkedAnalyzerAsync(array $args = [])
* @method \Aws\Result generateFindingRecommendation(array $args = [])
* @method \GuzzleHttp\Promise\Promise generateFindingRecommendationAsync(array $args = [])
* @method \Aws\Result getAccessPreview(array $args = [])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function __invoke(
// Content-Type must not be set
if ($operation['input'] !== null) {
$body = $this->serialize($operation->getInput(), $commandArgs);
$headers['Content-Length'] = strlen($body);
$headers['Content-Length'] = (string) strlen($body);
} else {
unset($headers['Content-Type']);
}
Expand Down
2 changes: 1 addition & 1 deletion aws/aws-sdk-php/src/Api/Serializer/JsonRpcSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function __invoke(
$headers = [
'X-Amz-Target' => $this->api->getMetadata('targetPrefix') . '.' . $operationName,
'Content-Type' => $this->contentType,
'Content-Length' => strlen($body)
'Content-Length' => (string) strlen($body)
];

if ($endpoint instanceof RulesetEndpoint) {
Expand Down
2 changes: 1 addition & 1 deletion aws/aws-sdk-php/src/Api/Serializer/QuerySerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function __invoke(
}
$body = http_build_query($body, '', '&', PHP_QUERY_RFC3986);
$headers = [
'Content-Length' => strlen($body),
'Content-Length' => (string) strlen($body),
'Content-Type' => 'application/x-www-form-urlencoded'
];
$requestUri = $operation['http']['requestUri'] ?? null;
Expand Down
2 changes: 1 addition & 1 deletion aws/aws-sdk-php/src/Api/Serializer/RestJsonSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected function payload(StructureShape $member, array|string $value, array &$
{
$opts['headers']['Content-Type'] = $this->contentType;
$body = $this->jsonFormatter->build($member, $value);
$opts['headers']['Content-Length'] = strlen($body);
$opts['headers']['Content-Length'] = (string) strlen($body);
$opts['body'] = $body;
}
}
58 changes: 53 additions & 5 deletions aws/aws-sdk-php/src/Api/Serializer/RestSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private function applyPayload(StructureShape $input, $name, array $args, array &

$body = $args[$name];
if (!$m['streaming'] && is_string($body)) {
$opts['headers']['Content-Length'] = strlen($body);
$opts['headers']['Content-Length'] = (string) strlen($body);
}

// Streaming bodies or payloads that are strings are
Expand All @@ -173,20 +173,36 @@ private function applyPayload(StructureShape $input, $name, array $args, array &

private function applyHeader($name, Shape $member, $value, array &$opts)
{
// Handle lists by recursively applying header logic to each element
if ($value === null) {
return;
}

// Handle lists by applying header logic to each element
if ($member instanceof ListShape) {
if (!is_array($value)) {
throw new \InvalidArgumentException('Header values must be scalar or an array of scalars.');
}

$listMember = $member->getMember();
$headerValues = [];

foreach ($value as $listValue) {
if ($listValue === null) {
throw new \InvalidArgumentException('Header values must be scalar or an array of scalars.');
}

$tempOpts = ['headers' => []];
$this->applyHeader('temp', $listMember, $listValue, $tempOpts);
if (!array_key_exists('temp', $tempOpts['headers'])) {
throw new \InvalidArgumentException('Header values must be scalar or an array of scalars.');
}

$convertedValue = $tempOpts['headers']['temp'];
$headerValues[] = $convertedValue;
}

$value = $headerValues;
} elseif (!is_null($value)) {
} else {
switch ($member->getType()) {
case 'timestamp':
$timestampFormat = $member['timestampFormat'] ?? 'rfc822';
Expand All @@ -208,7 +224,7 @@ private function applyHeader($name, Shape $member, $value, array &$opts)
$value = base64_encode($value);
}

$opts['headers'][$member['locationName'] ?: $name] = $value;
$opts['headers'][$member['locationName'] ?: $name] = self::prepareHeaderValue($value);
}

/**
Expand All @@ -218,10 +234,42 @@ private function applyHeaderMap($name, Shape $member, array $value, array &$opts
{
$prefix = $member['locationName'];
foreach ($value as $k => $v) {
$opts['headers'][$prefix . $k] = $v;
if ($v === null) {
continue;
}

$opts['headers'][$prefix . $k] = self::prepareHeaderValue($v);
}
}

/**
* @return string|string[]
*/
private static function prepareHeaderValue($value)
{
if (is_scalar($value)) {
return (string) $value;
}

if (is_array($value)) {
if ($value === []) {
return '';
}

foreach ($value as $key => $item) {
if (!is_scalar($item)) {
throw new \InvalidArgumentException('Header values must be scalar or an array of scalars.');
}

$value[$key] = (string) $item;
}

return $value;
}

throw new \InvalidArgumentException('Header values must be scalar or an array of scalars.');
}

private function applyQuery($name, Shape $member, $value, array &$opts)
{
if ($member instanceof MapShape) {
Expand Down
2 changes: 1 addition & 1 deletion aws/aws-sdk-php/src/Api/Serializer/RestXmlSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected function payload(StructureShape $member, array $value, array &$opts)
{
$opts['headers']['Content-Type'] = 'application/xml';
$body = $this->getXmlBody($member, $value);
$opts['headers']['Content-Length'] = strlen($body);
$opts['headers']['Content-Length'] = (string) strlen($body);
$opts['body'] = $body;
}

Expand Down
9 changes: 5 additions & 4 deletions aws/aws-sdk-php/src/AwsClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ private function addQueryModeHeader(): void
{
$list = $this->getHandlerList();
$list->appendBuild(
Middleware::mapRequest(function (RequestInterface $r) {
Middleware::mapRequest(static function (RequestInterface $r) {
return $r->withHeader(
'x-amzn-query-mode',
"true"
Expand Down Expand Up @@ -657,11 +657,12 @@ private function addUserAgentMiddleware($args)
*/
private function addEventStreamHttpFlagMiddleware(): void
{
$api = $this->getApi();
$this->getHandlerList()
-> appendInit(
function (callable $handler) {
return function (CommandInterface $command, $request = null) use ($handler) {
$operation = $this->getApi()->getOperation($command->getName());
static function (callable $handler) use ($api) {
return static function (CommandInterface $command, $request = null) use ($handler, $api) {
$operation = $api->getOperation($command->getName());
$output = $operation->getOutput();
foreach ($output->getMembers() as $memberProps) {
if (!empty($memberProps['eventstream'])) {
Expand Down
12 changes: 12 additions & 0 deletions aws/aws-sdk-php/src/BCMDashboards/BCMDashboardsClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,24 @@
* This client is used to interact with the **AWS Billing and Cost Management Dashboards** service.
* @method \Aws\Result createDashboard(array $args = [])
* @method \GuzzleHttp\Promise\Promise createDashboardAsync(array $args = [])
* @method \Aws\Result createScheduledReport(array $args = [])
* @method \GuzzleHttp\Promise\Promise createScheduledReportAsync(array $args = [])
* @method \Aws\Result deleteDashboard(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteDashboardAsync(array $args = [])
* @method \Aws\Result deleteScheduledReport(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteScheduledReportAsync(array $args = [])
* @method \Aws\Result executeScheduledReport(array $args = [])
* @method \GuzzleHttp\Promise\Promise executeScheduledReportAsync(array $args = [])
* @method \Aws\Result getDashboard(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDashboardAsync(array $args = [])
* @method \Aws\Result getResourcePolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise getResourcePolicyAsync(array $args = [])
* @method \Aws\Result getScheduledReport(array $args = [])
* @method \GuzzleHttp\Promise\Promise getScheduledReportAsync(array $args = [])
* @method \Aws\Result listDashboards(array $args = [])
* @method \GuzzleHttp\Promise\Promise listDashboardsAsync(array $args = [])
* @method \Aws\Result listScheduledReports(array $args = [])
* @method \GuzzleHttp\Promise\Promise listScheduledReportsAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
Expand All @@ -23,5 +33,7 @@
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateDashboard(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDashboardAsync(array $args = [])
* @method \Aws\Result updateScheduledReport(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateScheduledReportAsync(array $args = [])
*/
class BCMDashboardsClient extends AwsClient {}
2 changes: 2 additions & 0 deletions aws/aws-sdk-php/src/Backup/BackupClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@
* @method \GuzzleHttp\Promise\Promise getBackupVaultNotificationsAsync(array $args = [])
* @method \Aws\Result getLegalHold(array $args = [])
* @method \GuzzleHttp\Promise\Promise getLegalHoldAsync(array $args = [])
* @method \Aws\Result getPITRMalwareScanResults(array $args = [])
* @method \GuzzleHttp\Promise\Promise getPITRMalwareScanResultsAsync(array $args = [])
* @method \Aws\Result getRecoveryPointIndexDetails(array $args = [])
* @method \GuzzleHttp\Promise\Promise getRecoveryPointIndexDetailsAsync(array $args = [])
* @method \Aws\Result getRecoveryPointRestoreMetadata(array $args = [])
Expand Down
20 changes: 20 additions & 0 deletions aws/aws-sdk-php/src/Bedrock/BedrockClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@

/**
* This client is used to interact with the **Amazon Bedrock** service.
* @method \Aws\Result batchDeleteAdvancedPromptOptimizationJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise batchDeleteAdvancedPromptOptimizationJobAsync(array $args = [])
* @method \Aws\Result batchDeleteEvaluationJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise batchDeleteEvaluationJobAsync(array $args = [])
* @method \Aws\Result cancelAutomatedReasoningPolicyBuildWorkflow(array $args = [])
* @method \GuzzleHttp\Promise\Promise cancelAutomatedReasoningPolicyBuildWorkflowAsync(array $args = [])
* @method \Aws\Result createAdvancedPromptOptimizationJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAdvancedPromptOptimizationJobAsync(array $args = [])
* @method \Aws\Result createAutomatedReasoningPolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAutomatedReasoningPolicyAsync(array $args = [])
* @method \Aws\Result createAutomatedReasoningPolicyTestCase(array $args = [])
Expand Down Expand Up @@ -71,10 +75,16 @@
* @method \GuzzleHttp\Promise\Promise deletePromptRouterAsync(array $args = [])
* @method \Aws\Result deleteProvisionedModelThroughput(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteProvisionedModelThroughputAsync(array $args = [])
* @method \Aws\Result deleteResourcePolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteResourcePolicyAsync(array $args = [])
* @method \Aws\Result deregisterMarketplaceModelEndpoint(array $args = [])
* @method \GuzzleHttp\Promise\Promise deregisterMarketplaceModelEndpointAsync(array $args = [])
* @method \Aws\Result exportAutomatedReasoningPolicyVersion(array $args = [])
* @method \GuzzleHttp\Promise\Promise exportAutomatedReasoningPolicyVersionAsync(array $args = [])
* @method \Aws\Result getAccountDataRetention(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAccountDataRetentionAsync(array $args = [])
* @method \Aws\Result getAdvancedPromptOptimizationJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAdvancedPromptOptimizationJobAsync(array $args = [])
* @method \Aws\Result getAutomatedReasoningPolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAutomatedReasoningPolicyAsync(array $args = [])
* @method \Aws\Result getAutomatedReasoningPolicyAnnotations(array $args = [])
Expand Down Expand Up @@ -121,8 +131,12 @@
* @method \GuzzleHttp\Promise\Promise getPromptRouterAsync(array $args = [])
* @method \Aws\Result getProvisionedModelThroughput(array $args = [])
* @method \GuzzleHttp\Promise\Promise getProvisionedModelThroughputAsync(array $args = [])
* @method \Aws\Result getResourcePolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise getResourcePolicyAsync(array $args = [])
* @method \Aws\Result getUseCaseForModelAccess(array $args = [])
* @method \GuzzleHttp\Promise\Promise getUseCaseForModelAccessAsync(array $args = [])
* @method \Aws\Result listAdvancedPromptOptimizationJobs(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAdvancedPromptOptimizationJobsAsync(array $args = [])
* @method \Aws\Result listAutomatedReasoningPolicies(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAutomatedReasoningPoliciesAsync(array $args = [])
* @method \Aws\Result listAutomatedReasoningPolicyBuildWorkflows(array $args = [])
Expand Down Expand Up @@ -165,10 +179,14 @@
* @method \GuzzleHttp\Promise\Promise listProvisionedModelThroughputsAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result putAccountDataRetention(array $args = [])
* @method \GuzzleHttp\Promise\Promise putAccountDataRetentionAsync(array $args = [])
* @method \Aws\Result putEnforcedGuardrailConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise putEnforcedGuardrailConfigurationAsync(array $args = [])
* @method \Aws\Result putModelInvocationLoggingConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise putModelInvocationLoggingConfigurationAsync(array $args = [])
* @method \Aws\Result putResourcePolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise putResourcePolicyAsync(array $args = [])
* @method \Aws\Result putUseCaseForModelAccess(array $args = [])
* @method \GuzzleHttp\Promise\Promise putUseCaseForModelAccessAsync(array $args = [])
* @method \Aws\Result registerMarketplaceModelEndpoint(array $args = [])
Expand All @@ -177,6 +195,8 @@
* @method \GuzzleHttp\Promise\Promise startAutomatedReasoningPolicyBuildWorkflowAsync(array $args = [])
* @method \Aws\Result startAutomatedReasoningPolicyTestWorkflow(array $args = [])
* @method \GuzzleHttp\Promise\Promise startAutomatedReasoningPolicyTestWorkflowAsync(array $args = [])
* @method \Aws\Result stopAdvancedPromptOptimizationJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise stopAdvancedPromptOptimizationJobAsync(array $args = [])
* @method \Aws\Result stopEvaluationJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise stopEvaluationJobAsync(array $args = [])
* @method \Aws\Result stopModelCustomizationJob(array $args = [])
Expand Down
Loading
Loading