Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5c3b940

Browse files
Added GetAlias and ListAliases Lambda operations (#2067)
1 parent e5f76c1 commit 5c3b940

14 files changed

Lines changed: 1028 additions & 1 deletion

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### Added
66

7-
- Added `ListEventSourceMappings` and `PutFunctionConcurrency` operations.
7+
- Added `GetAlias`, `ListAliases`, `ListEventSourceMappings` and `PutFunctionConcurrency` operations.
88
- AWS api-change: Launching Lambda integration with S3 Files as a new file system configuration.
99

1010
## 2.13.1

src/Input/GetAliasRequest.php

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
<?php
2+
3+
namespace AsyncAws\Lambda\Input;
4+
5+
use AsyncAws\Core\Exception\InvalidArgument;
6+
use AsyncAws\Core\Input;
7+
use AsyncAws\Core\Request;
8+
use AsyncAws\Core\Stream\StreamFactory;
9+
10+
final class GetAliasRequest extends Input
11+
{
12+
/**
13+
* The name or ARN of the Lambda function.
14+
*
15+
* **Name formats**
16+
*
17+
* - **Function name** - `MyFunction`.
18+
* - **Function ARN** - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`.
19+
* - **Partial ARN** - `123456789012:function:MyFunction`.
20+
*
21+
* The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64
22+
* characters in length.
23+
*
24+
* @required
25+
*
26+
* @var string|null
27+
*/
28+
private $functionName;
29+
30+
/**
31+
* The name of the alias.
32+
*
33+
* @required
34+
*
35+
* @var string|null
36+
*/
37+
private $name;
38+
39+
/**
40+
* @param array{
41+
* FunctionName?: string,
42+
* Name?: string,
43+
* '@region'?: string|null,
44+
* } $input
45+
*/
46+
public function __construct(array $input = [])
47+
{
48+
$this->functionName = $input['FunctionName'] ?? null;
49+
$this->name = $input['Name'] ?? null;
50+
parent::__construct($input);
51+
}
52+
53+
/**
54+
* @param array{
55+
* FunctionName?: string,
56+
* Name?: string,
57+
* '@region'?: string|null,
58+
* }|GetAliasRequest $input
59+
*/
60+
public static function create($input): self
61+
{
62+
return $input instanceof self ? $input : new self($input);
63+
}
64+
65+
public function getFunctionName(): ?string
66+
{
67+
return $this->functionName;
68+
}
69+
70+
public function getName(): ?string
71+
{
72+
return $this->name;
73+
}
74+
75+
/**
76+
* @internal
77+
*/
78+
public function request(): Request
79+
{
80+
// Prepare headers
81+
$headers = [
82+
'Content-Type' => 'application/json',
83+
'Accept' => 'application/json',
84+
];
85+
86+
// Prepare query
87+
$query = [];
88+
89+
// Prepare URI
90+
$uri = [];
91+
if (null === $v = $this->functionName) {
92+
throw new InvalidArgument(\sprintf('Missing parameter "FunctionName" for "%s". The value cannot be null.', __CLASS__));
93+
}
94+
$uri['FunctionName'] = $v;
95+
if (null === $v = $this->name) {
96+
throw new InvalidArgument(\sprintf('Missing parameter "Name" for "%s". The value cannot be null.', __CLASS__));
97+
}
98+
$uri['Name'] = $v;
99+
$uriString = '/2015-03-31/functions/' . rawurlencode($uri['FunctionName']) . '/aliases/' . rawurlencode($uri['Name']);
100+
101+
// Prepare Body
102+
$body = '';
103+
104+
// Return the Request
105+
return new Request('GET', $uriString, $query, $headers, StreamFactory::create($body));
106+
}
107+
108+
public function setFunctionName(?string $value): self
109+
{
110+
$this->functionName = $value;
111+
112+
return $this;
113+
}
114+
115+
public function setName(?string $value): self
116+
{
117+
$this->name = $value;
118+
119+
return $this;
120+
}
121+
}

src/Input/ListAliasesRequest.php

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
<?php
2+
3+
namespace AsyncAws\Lambda\Input;
4+
5+
use AsyncAws\Core\Exception\InvalidArgument;
6+
use AsyncAws\Core\Input;
7+
use AsyncAws\Core\Request;
8+
use AsyncAws\Core\Stream\StreamFactory;
9+
10+
final class ListAliasesRequest extends Input
11+
{
12+
/**
13+
* The name or ARN of the Lambda function.
14+
*
15+
* **Name formats**
16+
*
17+
* - **Function name** - `MyFunction`.
18+
* - **Function ARN** - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`.
19+
* - **Partial ARN** - `123456789012:function:MyFunction`.
20+
*
21+
* The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64
22+
* characters in length.
23+
*
24+
* @required
25+
*
26+
* @var string|null
27+
*/
28+
private $functionName;
29+
30+
/**
31+
* Specify a function version to only list aliases that invoke that version.
32+
*
33+
* @var string|null
34+
*/
35+
private $functionVersion;
36+
37+
/**
38+
* Specify the pagination token that's returned by a previous request to retrieve the next page of results.
39+
*
40+
* @var string|null
41+
*/
42+
private $marker;
43+
44+
/**
45+
* Limit the number of aliases returned.
46+
*
47+
* @var int|null
48+
*/
49+
private $maxItems;
50+
51+
/**
52+
* @param array{
53+
* FunctionName?: string,
54+
* FunctionVersion?: string|null,
55+
* Marker?: string|null,
56+
* MaxItems?: int|null,
57+
* '@region'?: string|null,
58+
* } $input
59+
*/
60+
public function __construct(array $input = [])
61+
{
62+
$this->functionName = $input['FunctionName'] ?? null;
63+
$this->functionVersion = $input['FunctionVersion'] ?? null;
64+
$this->marker = $input['Marker'] ?? null;
65+
$this->maxItems = $input['MaxItems'] ?? null;
66+
parent::__construct($input);
67+
}
68+
69+
/**
70+
* @param array{
71+
* FunctionName?: string,
72+
* FunctionVersion?: string|null,
73+
* Marker?: string|null,
74+
* MaxItems?: int|null,
75+
* '@region'?: string|null,
76+
* }|ListAliasesRequest $input
77+
*/
78+
public static function create($input): self
79+
{
80+
return $input instanceof self ? $input : new self($input);
81+
}
82+
83+
public function getFunctionName(): ?string
84+
{
85+
return $this->functionName;
86+
}
87+
88+
public function getFunctionVersion(): ?string
89+
{
90+
return $this->functionVersion;
91+
}
92+
93+
public function getMarker(): ?string
94+
{
95+
return $this->marker;
96+
}
97+
98+
public function getMaxItems(): ?int
99+
{
100+
return $this->maxItems;
101+
}
102+
103+
/**
104+
* @internal
105+
*/
106+
public function request(): Request
107+
{
108+
// Prepare headers
109+
$headers = [
110+
'Content-Type' => 'application/json',
111+
'Accept' => 'application/json',
112+
];
113+
114+
// Prepare query
115+
$query = [];
116+
if (null !== $this->functionVersion) {
117+
$query['FunctionVersion'] = $this->functionVersion;
118+
}
119+
if (null !== $this->marker) {
120+
$query['Marker'] = $this->marker;
121+
}
122+
if (null !== $this->maxItems) {
123+
$query['MaxItems'] = (string) $this->maxItems;
124+
}
125+
126+
// Prepare URI
127+
$uri = [];
128+
if (null === $v = $this->functionName) {
129+
throw new InvalidArgument(\sprintf('Missing parameter "FunctionName" for "%s". The value cannot be null.', __CLASS__));
130+
}
131+
$uri['FunctionName'] = $v;
132+
$uriString = '/2015-03-31/functions/' . rawurlencode($uri['FunctionName']) . '/aliases';
133+
134+
// Prepare Body
135+
$body = '';
136+
137+
// Return the Request
138+
return new Request('GET', $uriString, $query, $headers, StreamFactory::create($body));
139+
}
140+
141+
public function setFunctionName(?string $value): self
142+
{
143+
$this->functionName = $value;
144+
145+
return $this;
146+
}
147+
148+
public function setFunctionVersion(?string $value): self
149+
{
150+
$this->functionVersion = $value;
151+
152+
return $this;
153+
}
154+
155+
public function setMarker(?string $value): self
156+
{
157+
$this->marker = $value;
158+
159+
return $this;
160+
}
161+
162+
public function setMaxItems(?int $value): self
163+
{
164+
$this->maxItems = $value;
165+
166+
return $this;
167+
}
168+
}

0 commit comments

Comments
 (0)