Skip to content

Commit a3695fd

Browse files
Update generated code (#1532)
update generated code
1 parent e62dac5 commit a3695fd

File tree

6 files changed

+119
-3
lines changed

6 files changed

+119
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## NOT RELEASED
44

5+
### Added
6+
7+
- AWS api-change: This release introduces automatic deletion of schedules in EventBridge Scheduler. If configured, EventBridge Scheduler automatically deletes a schedule after the schedule has completed its last invocation.
8+
59
## 1.0.0
610

711
### Fixed

src/Enum/ActionAfterCompletion.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace AsyncAws\Scheduler\Enum;
4+
5+
final class ActionAfterCompletion
6+
{
7+
public const DELETE = 'DELETE';
8+
public const NONE = 'NONE';
9+
10+
public static function exists(string $value): bool
11+
{
12+
return isset([
13+
self::DELETE => true,
14+
self::NONE => true,
15+
][$value]);
16+
}
17+
}

src/Input/CreateScheduleInput.php

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,21 @@
66
use AsyncAws\Core\Input;
77
use AsyncAws\Core\Request;
88
use AsyncAws\Core\Stream\StreamFactory;
9+
use AsyncAws\Scheduler\Enum\ActionAfterCompletion;
910
use AsyncAws\Scheduler\Enum\ScheduleState;
1011
use AsyncAws\Scheduler\ValueObject\FlexibleTimeWindow;
1112
use AsyncAws\Scheduler\ValueObject\Target;
1213

1314
final class CreateScheduleInput extends Input
1415
{
16+
/**
17+
* Specifies the action that EventBridge Scheduler applies to the schedule after the schedule completes invoking the
18+
* target.
19+
*
20+
* @var ActionAfterCompletion::*|null
21+
*/
22+
private $actionAfterCompletion;
23+
1524
/**
1625
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a
1726
* client token, EventBridge Scheduler uses a randomly generated token for the request to ensure idempotency.
@@ -73,7 +82,7 @@ final class CreateScheduleInput extends Input
7382
* The expression that defines when the schedule runs. The following formats are supported.
7483
*
7584
* - `at` expression - `at(yyyy-mm-ddThh:mm:ss)`
76-
* - `rate` expression - `rate(unit value)`
85+
* - `rate` expression - `rate(value unit)`
7786
* - `cron` expression - `cron(fields)`
7887
*
7988
* You can use `at` expressions to create one-time schedules that invoke a target once, at the time and in the time
@@ -133,6 +142,7 @@ final class CreateScheduleInput extends Input
133142

134143
/**
135144
* @param array{
145+
* ActionAfterCompletion?: ActionAfterCompletion::*,
136146
* ClientToken?: string,
137147
* Description?: string,
138148
* EndDate?: \DateTimeImmutable|string,
@@ -150,6 +160,7 @@ final class CreateScheduleInput extends Input
150160
*/
151161
public function __construct(array $input = [])
152162
{
163+
$this->actionAfterCompletion = $input['ActionAfterCompletion'] ?? null;
153164
$this->clientToken = $input['ClientToken'] ?? null;
154165
$this->description = $input['Description'] ?? null;
155166
$this->endDate = !isset($input['EndDate']) ? null : ($input['EndDate'] instanceof \DateTimeImmutable ? $input['EndDate'] : new \DateTimeImmutable($input['EndDate']));
@@ -167,6 +178,7 @@ public function __construct(array $input = [])
167178

168179
/**
169180
* @param array{
181+
* ActionAfterCompletion?: ActionAfterCompletion::*,
170182
* ClientToken?: string,
171183
* Description?: string,
172184
* EndDate?: \DateTimeImmutable|string,
@@ -187,6 +199,14 @@ public static function create($input): self
187199
return $input instanceof self ? $input : new self($input);
188200
}
189201

202+
/**
203+
* @return ActionAfterCompletion::*|null
204+
*/
205+
public function getActionAfterCompletion(): ?string
206+
{
207+
return $this->actionAfterCompletion;
208+
}
209+
190210
public function getClientToken(): ?string
191211
{
192212
return $this->clientToken;
@@ -277,6 +297,16 @@ public function request(): Request
277297
return new Request('POST', $uriString, $query, $headers, StreamFactory::create($body));
278298
}
279299

300+
/**
301+
* @param ActionAfterCompletion::*|null $value
302+
*/
303+
public function setActionAfterCompletion(?string $value): self
304+
{
305+
$this->actionAfterCompletion = $value;
306+
307+
return $this;
308+
}
309+
280310
public function setClientToken(?string $value): self
281311
{
282312
$this->clientToken = $value;
@@ -367,6 +397,12 @@ public function setTarget(?Target $value): self
367397
private function requestBody(): array
368398
{
369399
$payload = [];
400+
if (null !== $v = $this->actionAfterCompletion) {
401+
if (!ActionAfterCompletion::exists($v)) {
402+
throw new InvalidArgument(sprintf('Invalid parameter "ActionAfterCompletion" for "%s". The value "%s" is not a valid "ActionAfterCompletion".', __CLASS__, $v));
403+
}
404+
$payload['ActionAfterCompletion'] = $v;
405+
}
370406
if (null === $v = $this->clientToken) {
371407
$v = uuid_create(\UUID_TYPE_RANDOM);
372408
}

src/Input/UpdateScheduleInput.php

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,21 @@
66
use AsyncAws\Core\Input;
77
use AsyncAws\Core\Request;
88
use AsyncAws\Core\Stream\StreamFactory;
9+
use AsyncAws\Scheduler\Enum\ActionAfterCompletion;
910
use AsyncAws\Scheduler\Enum\ScheduleState;
1011
use AsyncAws\Scheduler\ValueObject\FlexibleTimeWindow;
1112
use AsyncAws\Scheduler\ValueObject\Target;
1213

1314
final class UpdateScheduleInput extends Input
1415
{
16+
/**
17+
* Specifies the action that EventBridge Scheduler applies to the schedule after the schedule completes invoking the
18+
* target.
19+
*
20+
* @var ActionAfterCompletion::*|null
21+
*/
22+
private $actionAfterCompletion;
23+
1524
/**
1625
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a
1726
* client token, EventBridge Scheduler uses a randomly generated token for the request to ensure idempotency.
@@ -75,7 +84,7 @@ final class UpdateScheduleInput extends Input
7584
* The expression that defines when the schedule runs. The following formats are supported.
7685
*
7786
* - `at` expression - `at(yyyy-mm-ddThh:mm:ss)`
78-
* - `rate` expression - `rate(unit value)`
87+
* - `rate` expression - `rate(value unit)`
7988
* - `cron` expression - `cron(fields)`
8089
*
8190
* You can use `at` expressions to create one-time schedules that invoke a target once, at the time and in the time
@@ -135,6 +144,7 @@ final class UpdateScheduleInput extends Input
135144

136145
/**
137146
* @param array{
147+
* ActionAfterCompletion?: ActionAfterCompletion::*,
138148
* ClientToken?: string,
139149
* Description?: string,
140150
* EndDate?: \DateTimeImmutable|string,
@@ -152,6 +162,7 @@ final class UpdateScheduleInput extends Input
152162
*/
153163
public function __construct(array $input = [])
154164
{
165+
$this->actionAfterCompletion = $input['ActionAfterCompletion'] ?? null;
155166
$this->clientToken = $input['ClientToken'] ?? null;
156167
$this->description = $input['Description'] ?? null;
157168
$this->endDate = !isset($input['EndDate']) ? null : ($input['EndDate'] instanceof \DateTimeImmutable ? $input['EndDate'] : new \DateTimeImmutable($input['EndDate']));
@@ -169,6 +180,7 @@ public function __construct(array $input = [])
169180

170181
/**
171182
* @param array{
183+
* ActionAfterCompletion?: ActionAfterCompletion::*,
172184
* ClientToken?: string,
173185
* Description?: string,
174186
* EndDate?: \DateTimeImmutable|string,
@@ -189,6 +201,14 @@ public static function create($input): self
189201
return $input instanceof self ? $input : new self($input);
190202
}
191203

204+
/**
205+
* @return ActionAfterCompletion::*|null
206+
*/
207+
public function getActionAfterCompletion(): ?string
208+
{
209+
return $this->actionAfterCompletion;
210+
}
211+
192212
public function getClientToken(): ?string
193213
{
194214
return $this->clientToken;
@@ -279,6 +299,16 @@ public function request(): Request
279299
return new Request('PUT', $uriString, $query, $headers, StreamFactory::create($body));
280300
}
281301

302+
/**
303+
* @param ActionAfterCompletion::*|null $value
304+
*/
305+
public function setActionAfterCompletion(?string $value): self
306+
{
307+
$this->actionAfterCompletion = $value;
308+
309+
return $this;
310+
}
311+
282312
public function setClientToken(?string $value): self
283313
{
284314
$this->clientToken = $value;
@@ -369,6 +399,12 @@ public function setTarget(?Target $value): self
369399
private function requestBody(): array
370400
{
371401
$payload = [];
402+
if (null !== $v = $this->actionAfterCompletion) {
403+
if (!ActionAfterCompletion::exists($v)) {
404+
throw new InvalidArgument(sprintf('Invalid parameter "ActionAfterCompletion" for "%s". The value "%s" is not a valid "ActionAfterCompletion".', __CLASS__, $v));
405+
}
406+
$payload['ActionAfterCompletion'] = $v;
407+
}
372408
if (null === $v = $this->clientToken) {
373409
$v = uuid_create(\UUID_TYPE_RANDOM);
374410
}

src/Result/GetScheduleOutput.php

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

55
use AsyncAws\Core\Response;
66
use AsyncAws\Core\Result;
7+
use AsyncAws\Scheduler\Enum\ActionAfterCompletion;
78
use AsyncAws\Scheduler\Enum\ScheduleState;
89
use AsyncAws\Scheduler\ValueObject\AwsVpcConfiguration;
910
use AsyncAws\Scheduler\ValueObject\CapacityProviderStrategyItem;
@@ -23,6 +24,14 @@
2324

2425
class GetScheduleOutput extends Result
2526
{
27+
/**
28+
* Indicates the action that EventBridge Scheduler applies to the schedule after the schedule completes invoking the
29+
* target.
30+
*
31+
* @var ActionAfterCompletion::*|null
32+
*/
33+
private $actionAfterCompletion;
34+
2635
/**
2736
* The Amazon Resource Name (ARN) of the schedule.
2837
*
@@ -92,7 +101,7 @@ class GetScheduleOutput extends Result
92101
* The expression that defines when the schedule runs. The following formats are supported.
93102
*
94103
* - `at` expression - `at(yyyy-mm-ddThh:mm:ss)`
95-
* - `rate` expression - `rate(unit value)`
104+
* - `rate` expression - `rate(value unit)`
96105
* - `cron` expression - `cron(fields)`
97106
*
98107
* You can use `at` expressions to create one-time schedules that invoke a target once, at the time and in the time
@@ -146,6 +155,16 @@ class GetScheduleOutput extends Result
146155
*/
147156
private $target;
148157

158+
/**
159+
* @return ActionAfterCompletion::*|null
160+
*/
161+
public function getActionAfterCompletion(): ?string
162+
{
163+
$this->initialize();
164+
165+
return $this->actionAfterCompletion;
166+
}
167+
149168
public function getArn(): ?string
150169
{
151170
$this->initialize();
@@ -251,6 +270,7 @@ protected function populateResult(Response $response): void
251270
{
252271
$data = $response->toArray();
253272

273+
$this->actionAfterCompletion = isset($data['ActionAfterCompletion']) ? (string) $data['ActionAfterCompletion'] : null;
254274
$this->arn = isset($data['Arn']) ? (string) $data['Arn'] : null;
255275
$this->creationDate = isset($data['CreationDate']) && ($d = \DateTimeImmutable::createFromFormat('U.u', sprintf('%.6F', $data['CreationDate']))) ? $d : null;
256276
$this->description = isset($data['Description']) ? (string) $data['Description'] : null;

src/SchedulerClient.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use AsyncAws\Core\AwsError\JsonRestAwsErrorFactory;
88
use AsyncAws\Core\Configuration;
99
use AsyncAws\Core\RequestContext;
10+
use AsyncAws\Scheduler\Enum\ActionAfterCompletion;
1011
use AsyncAws\Scheduler\Enum\ScheduleState;
1112
use AsyncAws\Scheduler\Exception\ConflictException;
1213
use AsyncAws\Scheduler\Exception\InternalServerException;
@@ -45,6 +46,7 @@ class SchedulerClient extends AbstractApi
4546
* @see https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-scheduler-2021-06-30.html#createschedule
4647
*
4748
* @param array{
49+
* ActionAfterCompletion?: ActionAfterCompletion::*,
4850
* ClientToken?: string,
4951
* Description?: string,
5052
* EndDate?: \DateTimeImmutable|string,
@@ -319,6 +321,7 @@ public function listSchedules($input = []): ListSchedulesOutput
319321
* @see https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-scheduler-2021-06-30.html#updateschedule
320322
*
321323
* @param array{
324+
* ActionAfterCompletion?: ActionAfterCompletion::*,
322325
* ClientToken?: string,
323326
* Description?: string,
324327
* EndDate?: \DateTimeImmutable|string,

0 commit comments

Comments
 (0)