LambdaClient.php
6.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?php
namespace Aws\Lambda;
use Aws\AwsClient;
use Aws\CommandInterface;
use Aws\Middleware;
/**
* This client is used to interact with AWS Lambda
*
* @method \Aws\Result addLayerVersionPermission(array $args = [])
* @method \GuzzleHttp\Promise\Promise addLayerVersionPermissionAsync(array $args = [])
* @method \Aws\Result addPermission(array $args = [])
* @method \GuzzleHttp\Promise\Promise addPermissionAsync(array $args = [])
* @method \Aws\Result createAlias(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAliasAsync(array $args = [])
* @method \Aws\Result createEventSourceMapping(array $args = [])
* @method \GuzzleHttp\Promise\Promise createEventSourceMappingAsync(array $args = [])
* @method \Aws\Result createFunction(array $args = [])
* @method \GuzzleHttp\Promise\Promise createFunctionAsync(array $args = [])
* @method \Aws\Result deleteAlias(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAliasAsync(array $args = [])
* @method \Aws\Result deleteEventSourceMapping(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteEventSourceMappingAsync(array $args = [])
* @method \Aws\Result deleteFunction(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteFunctionAsync(array $args = [])
* @method \Aws\Result deleteFunctionConcurrency(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteFunctionConcurrencyAsync(array $args = [])
* @method \Aws\Result deleteLayerVersion(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteLayerVersionAsync(array $args = [])
* @method \Aws\Result getAccountSettings(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAccountSettingsAsync(array $args = [])
* @method \Aws\Result getAlias(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAliasAsync(array $args = [])
* @method \Aws\Result getEventSourceMapping(array $args = [])
* @method \GuzzleHttp\Promise\Promise getEventSourceMappingAsync(array $args = [])
* @method \Aws\Result getFunction(array $args = [])
* @method \GuzzleHttp\Promise\Promise getFunctionAsync(array $args = [])
* @method \Aws\Result getFunctionConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise getFunctionConfigurationAsync(array $args = [])
* @method \Aws\Result getLayerVersion(array $args = [])
* @method \GuzzleHttp\Promise\Promise getLayerVersionAsync(array $args = [])
* @method \Aws\Result getLayerVersionByArn(array $args = [])
* @method \GuzzleHttp\Promise\Promise getLayerVersionByArnAsync(array $args = [])
* @method \Aws\Result getLayerVersionPolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise getLayerVersionPolicyAsync(array $args = [])
* @method \Aws\Result getPolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise getPolicyAsync(array $args = [])
* @method \Aws\Result invoke(array $args = [])
* @method \GuzzleHttp\Promise\Promise invokeAsync(array $args = [])
* @method \Aws\Result invokeAsync(array $args = [])
* @method \GuzzleHttp\Promise\Promise invokeAsyncAsync(array $args = [])
* @method \Aws\Result listAliases(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAliasesAsync(array $args = [])
* @method \Aws\Result listEventSourceMappings(array $args = [])
* @method \GuzzleHttp\Promise\Promise listEventSourceMappingsAsync(array $args = [])
* @method \Aws\Result listFunctions(array $args = [])
* @method \GuzzleHttp\Promise\Promise listFunctionsAsync(array $args = [])
* @method \Aws\Result listLayerVersions(array $args = [])
* @method \GuzzleHttp\Promise\Promise listLayerVersionsAsync(array $args = [])
* @method \Aws\Result listLayers(array $args = [])
* @method \GuzzleHttp\Promise\Promise listLayersAsync(array $args = [])
* @method \Aws\Result listTags(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsAsync(array $args = [])
* @method \Aws\Result listVersionsByFunction(array $args = [])
* @method \GuzzleHttp\Promise\Promise listVersionsByFunctionAsync(array $args = [])
* @method \Aws\Result publishLayerVersion(array $args = [])
* @method \GuzzleHttp\Promise\Promise publishLayerVersionAsync(array $args = [])
* @method \Aws\Result publishVersion(array $args = [])
* @method \GuzzleHttp\Promise\Promise publishVersionAsync(array $args = [])
* @method \Aws\Result putFunctionConcurrency(array $args = [])
* @method \GuzzleHttp\Promise\Promise putFunctionConcurrencyAsync(array $args = [])
* @method \Aws\Result removeLayerVersionPermission(array $args = [])
* @method \GuzzleHttp\Promise\Promise removeLayerVersionPermissionAsync(array $args = [])
* @method \Aws\Result removePermission(array $args = [])
* @method \GuzzleHttp\Promise\Promise removePermissionAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateAlias(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateAliasAsync(array $args = [])
* @method \Aws\Result updateEventSourceMapping(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateEventSourceMappingAsync(array $args = [])
* @method \Aws\Result updateFunctionCode(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateFunctionCodeAsync(array $args = [])
* @method \Aws\Result updateFunctionConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateFunctionConfigurationAsync(array $args = [])
*/
class LambdaClient extends AwsClient
{
/**
* {@inheritdoc}
*/
public function __construct(array $args)
{
parent::__construct($args);
$list = $this->getHandlerList();
if (extension_loaded('curl')) {
$list->appendInit($this->getDefaultCurlOptionsMiddleware());
}
}
/**
* Provides a middleware that sets default Curl options for the command
*
* @return callable
*/
public function getDefaultCurlOptionsMiddleware()
{
return Middleware::mapCommand(function (CommandInterface $cmd) {
$defaultCurlOptions = [
CURLOPT_TCP_KEEPALIVE => 1,
];
if (!isset($cmd['@http']['curl'])) {
$cmd['@http']['curl'] = $defaultCurlOptions;
} else {
$cmd['@http']['curl'] += $defaultCurlOptions;
}
return $cmd;
});
}
}