Skip to content

Commit fcfc785

Browse files
authored
Adding Lambda and SNS (#170)
* Adding Lambda and SNS * cs
0 parents  commit fcfc785

25 files changed

+1830
-0
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/Tests export-ignore
2+
/phpunit.xml.dist export-ignore
3+
/.gitignore export-ignore

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: [nyholm, jderusse]

.github/workflows/.editorconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[*.yml]
2+
indent_size = 2

.github/workflows/checks.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: BC Check
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
roave-bc-check:
10+
name: Roave BC Check
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v2
16+
17+
- name: Roave BC Check
18+
uses: docker://nyholm/roave-bc-check-ga

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
10+
build:
11+
name: Build
12+
runs-on: ubuntu-latest
13+
strategy:
14+
max-parallel: 10
15+
matrix:
16+
php: ['7.2', '7.3', '7.4']
17+
18+
steps:
19+
- name: Set up PHP
20+
uses: shivammathur/[email protected]
21+
with:
22+
php-version: ${{ matrix.php }}
23+
coverage: xdebug
24+
ini-values: xdebug.overload_var_dump=1
25+
tools: prestissimo
26+
27+
- name: Checkout code
28+
uses: actions/checkout@v2
29+
30+
- name: Download dependencies
31+
run: |
32+
composer config minimum-stability dev
33+
composer req symfony/phpunit-bridge --no-update
34+
composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable
35+
36+
- name: Initialize tests
37+
run: make initialize
38+
39+
- name: Run tests
40+
run: ./vendor/bin/simple-phpunit

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/vendor/
2+
.php_cs.cache
3+
.phpunit.result.cache
4+
composer.lock
Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
<?php
2+
3+
namespace AsyncAws\Lambda\Input;
4+
5+
use AsyncAws\Core\Exception\InvalidArgument;
6+
7+
class AddLayerVersionPermissionRequest
8+
{
9+
/**
10+
* The name or Amazon Resource Name (ARN) of the layer.
11+
*
12+
* @required
13+
*
14+
* @var string|null
15+
*/
16+
private $LayerName;
17+
18+
/**
19+
* The version number.
20+
*
21+
* @required
22+
*
23+
* @var string|null
24+
*/
25+
private $VersionNumber;
26+
27+
/**
28+
* An identifier that distinguishes the policy from others on the same layer version.
29+
*
30+
* @required
31+
*
32+
* @var string|null
33+
*/
34+
private $StatementId;
35+
36+
/**
37+
* The API action that grants access to the layer. For example, `lambda:GetLayerVersion`.
38+
*
39+
* @required
40+
*
41+
* @var string|null
42+
*/
43+
private $Action;
44+
45+
/**
46+
* An account ID, or `*` to grant permission to all AWS accounts.
47+
*
48+
* @required
49+
*
50+
* @var string|null
51+
*/
52+
private $Principal;
53+
54+
/**
55+
* With the principal set to `*`, grant permission to all accounts in the specified organization.
56+
*
57+
* @var string|null
58+
*/
59+
private $OrganizationId;
60+
61+
/**
62+
* Only update the policy if the revision ID matches the ID specified. Use this option to avoid modifying a policy that
63+
* has changed since you last read it.
64+
*
65+
* @var string|null
66+
*/
67+
private $RevisionId;
68+
69+
/**
70+
* @param array{
71+
* LayerName?: string,
72+
* VersionNumber?: string,
73+
* StatementId?: string,
74+
* Action?: string,
75+
* Principal?: string,
76+
* OrganizationId?: string,
77+
* RevisionId?: string,
78+
* } $input
79+
*/
80+
public function __construct(array $input = [])
81+
{
82+
$this->LayerName = $input['LayerName'] ?? null;
83+
$this->VersionNumber = $input['VersionNumber'] ?? null;
84+
$this->StatementId = $input['StatementId'] ?? null;
85+
$this->Action = $input['Action'] ?? null;
86+
$this->Principal = $input['Principal'] ?? null;
87+
$this->OrganizationId = $input['OrganizationId'] ?? null;
88+
$this->RevisionId = $input['RevisionId'] ?? null;
89+
}
90+
91+
public static function create($input): self
92+
{
93+
return $input instanceof self ? $input : new self($input);
94+
}
95+
96+
public function getAction(): ?string
97+
{
98+
return $this->Action;
99+
}
100+
101+
public function getLayerName(): ?string
102+
{
103+
return $this->LayerName;
104+
}
105+
106+
public function getOrganizationId(): ?string
107+
{
108+
return $this->OrganizationId;
109+
}
110+
111+
public function getPrincipal(): ?string
112+
{
113+
return $this->Principal;
114+
}
115+
116+
public function getRevisionId(): ?string
117+
{
118+
return $this->RevisionId;
119+
}
120+
121+
public function getStatementId(): ?string
122+
{
123+
return $this->StatementId;
124+
}
125+
126+
public function getVersionNumber(): ?string
127+
{
128+
return $this->VersionNumber;
129+
}
130+
131+
public function requestBody(): array
132+
{
133+
$payload = ['Action' => 'AddLayerVersionPermission', 'Version' => '2015-03-31'];
134+
135+
$payload['StatementId'] = $this->StatementId;
136+
$payload['Action'] = $this->Action;
137+
$payload['Principal'] = $this->Principal;
138+
139+
if (null !== $v = $this->OrganizationId) {
140+
$payload['OrganizationId'] = $v;
141+
}
142+
143+
return $payload;
144+
}
145+
146+
public function requestHeaders(): array
147+
{
148+
$headers = [];
149+
150+
return $headers;
151+
}
152+
153+
public function requestQuery(): array
154+
{
155+
$query = [];
156+
if (null !== $this->RevisionId) {
157+
$query['RevisionId'] = $this->RevisionId;
158+
}
159+
160+
return $query;
161+
}
162+
163+
public function requestUri(): string
164+
{
165+
$uri = [];
166+
$uri['LayerName'] = $this->LayerName ?? '';
167+
$uri['VersionNumber'] = $this->VersionNumber ?? '';
168+
169+
return "/2018-10-31/layers/{$uri['LayerName']}/versions/{$uri['VersionNumber']}/policy";
170+
}
171+
172+
public function setAction(?string $value): self
173+
{
174+
$this->Action = $value;
175+
176+
return $this;
177+
}
178+
179+
public function setLayerName(?string $value): self
180+
{
181+
$this->LayerName = $value;
182+
183+
return $this;
184+
}
185+
186+
public function setOrganizationId(?string $value): self
187+
{
188+
$this->OrganizationId = $value;
189+
190+
return $this;
191+
}
192+
193+
public function setPrincipal(?string $value): self
194+
{
195+
$this->Principal = $value;
196+
197+
return $this;
198+
}
199+
200+
public function setRevisionId(?string $value): self
201+
{
202+
$this->RevisionId = $value;
203+
204+
return $this;
205+
}
206+
207+
public function setStatementId(?string $value): self
208+
{
209+
$this->StatementId = $value;
210+
211+
return $this;
212+
}
213+
214+
public function setVersionNumber(?string $value): self
215+
{
216+
$this->VersionNumber = $value;
217+
218+
return $this;
219+
}
220+
221+
public function validate(): void
222+
{
223+
foreach (['LayerName', 'VersionNumber', 'StatementId', 'Action', 'Principal'] as $name) {
224+
if (null === $this->$name) {
225+
throw new InvalidArgument(sprintf('Missing parameter "%s" when validating the "%s". The value cannot be null.', $name, __CLASS__));
226+
}
227+
}
228+
}
229+
}

0 commit comments

Comments
 (0)