Skip to content

Commit f0f9d4b

Browse files
Update generated code (#1756)
update generated code
1 parent 3c0238e commit f0f9d4b

File tree

9 files changed

+230
-5
lines changed

9 files changed

+230
-5
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"variables": {
3-
"${LATEST}": "3.320.6"
3+
"${LATEST}": "3.321.2"
44
},
55
"endpoints": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/endpoints.json",
66
"services": {

src/Service/CloudWatchLogs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Added
66

77
- AWS api-change: Added `ap-southeast-5` region
8+
- AWS api-change: This release introduces a new optional parameter: Entity, in PutLogEvents request
89

910
### Changed
1011

src/Service/CloudWatchLogs/src/CloudWatchLogsClient.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use AsyncAws\CloudWatchLogs\Result\DescribeLogStreamsResponse;
2222
use AsyncAws\CloudWatchLogs\Result\FilterLogEventsResponse;
2323
use AsyncAws\CloudWatchLogs\Result\PutLogEventsResponse;
24+
use AsyncAws\CloudWatchLogs\ValueObject\Entity;
2425
use AsyncAws\CloudWatchLogs\ValueObject\InputLogEvent;
2526
use AsyncAws\Core\AbstractApi;
2627
use AsyncAws\Core\AwsError\AwsErrorFactoryInterface;
@@ -268,6 +269,7 @@ public function filterLogEvents($input = []): FilterLogEventsResponse
268269
* logStreamName: string,
269270
* logEvents: array<InputLogEvent|array>,
270271
* sequenceToken?: null|string,
272+
* entity?: null|Entity|array,
271273
* '@region'?: string|null,
272274
* }|PutLogEventsRequest $input
273275
*
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace AsyncAws\CloudWatchLogs\Enum;
4+
5+
final class EntityRejectionErrorType
6+
{
7+
public const ENTITY_SIZE_TOO_LARGE = 'EntitySizeTooLarge';
8+
public const INVALID_ATTRIBUTES = 'InvalidAttributes';
9+
public const INVALID_ENTITY = 'InvalidEntity';
10+
public const INVALID_KEY_ATTRIBUTES = 'InvalidKeyAttributes';
11+
public const INVALID_TYPE_VALUE = 'InvalidTypeValue';
12+
public const MISSING_REQUIRED_FIELDS = 'MissingRequiredFields';
13+
public const UNSUPPORTED_LOG_GROUP_TYPE = 'UnsupportedLogGroupType';
14+
15+
public static function exists(string $value): bool
16+
{
17+
return isset([
18+
self::ENTITY_SIZE_TOO_LARGE => true,
19+
self::INVALID_ATTRIBUTES => true,
20+
self::INVALID_ENTITY => true,
21+
self::INVALID_KEY_ATTRIBUTES => true,
22+
self::INVALID_TYPE_VALUE => true,
23+
self::MISSING_REQUIRED_FIELDS => true,
24+
self::UNSUPPORTED_LOG_GROUP_TYPE => true,
25+
][$value]);
26+
}
27+
}

src/Service/CloudWatchLogs/src/Input/FilterLogEventsRequest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class FilterLogEventsRequest extends Input
3030
/**
3131
* Filters the results to only logs from the log streams in this list.
3232
*
33-
* If you specify a value for both `logStreamNamePrefix` and `logStreamNames`, the action returns an
33+
* If you specify a value for both `logStreamNames` and `logStreamNamePrefix`, the action returns an
3434
* `InvalidParameterException` error.
3535
*
3636
* @var string[]|null
@@ -40,9 +40,8 @@ final class FilterLogEventsRequest extends Input
4040
/**
4141
* Filters the results to include only events from log streams that have names starting with this prefix.
4242
*
43-
* If you specify a value for both `logStreamNamePrefix` and `logStreamNames`, but the value for `logStreamNamePrefix`
44-
* does not match any log stream names specified in `logStreamNames`, the action returns an `InvalidParameterException`
45-
* error.
43+
* If you specify a value for both `logStreamNamePrefix` and `logStreamNames`, the action returns an
44+
* `InvalidParameterException` error.
4645
*
4746
* @var string|null
4847
*/

src/Service/CloudWatchLogs/src/Input/PutLogEventsRequest.php

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

33
namespace AsyncAws\CloudWatchLogs\Input;
44

5+
use AsyncAws\CloudWatchLogs\ValueObject\Entity;
56
use AsyncAws\CloudWatchLogs\ValueObject\InputLogEvent;
67
use AsyncAws\Core\Exception\InvalidArgument;
78
use AsyncAws\Core\Input;
@@ -48,12 +49,20 @@ final class PutLogEventsRequest extends Input
4849
*/
4950
private $sequenceToken;
5051

52+
/**
53+
* Reserved for future use.
54+
*
55+
* @var Entity|null
56+
*/
57+
private $entity;
58+
5159
/**
5260
* @param array{
5361
* logGroupName?: string,
5462
* logStreamName?: string,
5563
* logEvents?: array<InputLogEvent|array>,
5664
* sequenceToken?: null|string,
65+
* entity?: null|Entity|array,
5766
* '@region'?: string|null,
5867
* } $input
5968
*/
@@ -63,6 +72,7 @@ public function __construct(array $input = [])
6372
$this->logStreamName = $input['logStreamName'] ?? null;
6473
$this->logEvents = isset($input['logEvents']) ? array_map([InputLogEvent::class, 'create'], $input['logEvents']) : null;
6574
$this->sequenceToken = $input['sequenceToken'] ?? null;
75+
$this->entity = isset($input['entity']) ? Entity::create($input['entity']) : null;
6676
parent::__construct($input);
6777
}
6878

@@ -72,6 +82,7 @@ public function __construct(array $input = [])
7282
* logStreamName?: string,
7383
* logEvents?: array<InputLogEvent|array>,
7484
* sequenceToken?: null|string,
85+
* entity?: null|Entity|array,
7586
* '@region'?: string|null,
7687
* }|PutLogEventsRequest $input
7788
*/
@@ -80,6 +91,11 @@ public static function create($input): self
8091
return $input instanceof self ? $input : new self($input);
8192
}
8293

94+
public function getEntity(): ?Entity
95+
{
96+
return $this->entity;
97+
}
98+
8399
/**
84100
* @return InputLogEvent[]
85101
*/
@@ -129,6 +145,13 @@ public function request(): Request
129145
return new Request('POST', $uriString, $query, $headers, StreamFactory::create($body));
130146
}
131147

148+
public function setEntity(?Entity $value): self
149+
{
150+
$this->entity = $value;
151+
152+
return $this;
153+
}
154+
132155
/**
133156
* @param InputLogEvent[] $value
134157
*/
@@ -185,6 +208,9 @@ private function requestBody(): array
185208
if (null !== $v = $this->sequenceToken) {
186209
$payload['sequenceToken'] = $v;
187210
}
211+
if (null !== $v = $this->entity) {
212+
$payload['entity'] = $v->requestBody();
213+
}
188214

189215
return $payload;
190216
}

src/Service/CloudWatchLogs/src/Result/PutLogEventsResponse.php

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

33
namespace AsyncAws\CloudWatchLogs\Result;
44

5+
use AsyncAws\CloudWatchLogs\ValueObject\RejectedEntityInfo;
56
use AsyncAws\CloudWatchLogs\ValueObject\RejectedLogEventsInfo;
67
use AsyncAws\Core\Response;
78
use AsyncAws\Core\Result;
@@ -28,13 +29,27 @@ class PutLogEventsResponse extends Result
2829
*/
2930
private $rejectedLogEventsInfo;
3031

32+
/**
33+
* Reserved for future use.
34+
*
35+
* @var RejectedEntityInfo|null
36+
*/
37+
private $rejectedEntityInfo;
38+
3139
public function getNextSequenceToken(): ?string
3240
{
3341
$this->initialize();
3442

3543
return $this->nextSequenceToken;
3644
}
3745

46+
public function getRejectedEntityInfo(): ?RejectedEntityInfo
47+
{
48+
$this->initialize();
49+
50+
return $this->rejectedEntityInfo;
51+
}
52+
3853
public function getRejectedLogEventsInfo(): ?RejectedLogEventsInfo
3954
{
4055
$this->initialize();
@@ -48,6 +63,14 @@ protected function populateResult(Response $response): void
4863

4964
$this->nextSequenceToken = isset($data['nextSequenceToken']) ? (string) $data['nextSequenceToken'] : null;
5065
$this->rejectedLogEventsInfo = empty($data['rejectedLogEventsInfo']) ? null : $this->populateResultRejectedLogEventsInfo($data['rejectedLogEventsInfo']);
66+
$this->rejectedEntityInfo = empty($data['rejectedEntityInfo']) ? null : $this->populateResultRejectedEntityInfo($data['rejectedEntityInfo']);
67+
}
68+
69+
private function populateResultRejectedEntityInfo(array $json): RejectedEntityInfo
70+
{
71+
return new RejectedEntityInfo([
72+
'errorType' => (string) $json['errorType'],
73+
]);
5174
}
5275

5376
private function populateResultRejectedLogEventsInfo(array $json): RejectedLogEventsInfo
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?php
2+
3+
namespace AsyncAws\CloudWatchLogs\ValueObject;
4+
5+
/**
6+
* Reserved for future use.
7+
*/
8+
final class Entity
9+
{
10+
/**
11+
* Reserved for future use.
12+
*
13+
* @var array<string, string>|null
14+
*/
15+
private $keyAttributes;
16+
17+
/**
18+
* Reserved for future use.
19+
*
20+
* @var array<string, string>|null
21+
*/
22+
private $attributes;
23+
24+
/**
25+
* @param array{
26+
* keyAttributes?: null|array<string, string>,
27+
* attributes?: null|array<string, string>,
28+
* } $input
29+
*/
30+
public function __construct(array $input)
31+
{
32+
$this->keyAttributes = $input['keyAttributes'] ?? null;
33+
$this->attributes = $input['attributes'] ?? null;
34+
}
35+
36+
/**
37+
* @param array{
38+
* keyAttributes?: null|array<string, string>,
39+
* attributes?: null|array<string, string>,
40+
* }|Entity $input
41+
*/
42+
public static function create($input): self
43+
{
44+
return $input instanceof self ? $input : new self($input);
45+
}
46+
47+
/**
48+
* @return array<string, string>
49+
*/
50+
public function getAttributes(): array
51+
{
52+
return $this->attributes ?? [];
53+
}
54+
55+
/**
56+
* @return array<string, string>
57+
*/
58+
public function getKeyAttributes(): array
59+
{
60+
return $this->keyAttributes ?? [];
61+
}
62+
63+
/**
64+
* @internal
65+
*/
66+
public function requestBody(): array
67+
{
68+
$payload = [];
69+
if (null !== $v = $this->keyAttributes) {
70+
if (empty($v)) {
71+
$payload['keyAttributes'] = new \stdClass();
72+
} else {
73+
$payload['keyAttributes'] = [];
74+
foreach ($v as $name => $mv) {
75+
$payload['keyAttributes'][$name] = $mv;
76+
}
77+
}
78+
}
79+
if (null !== $v = $this->attributes) {
80+
if (empty($v)) {
81+
$payload['attributes'] = new \stdClass();
82+
} else {
83+
$payload['attributes'] = [];
84+
foreach ($v as $name => $mv) {
85+
$payload['attributes'][$name] = $mv;
86+
}
87+
}
88+
}
89+
90+
return $payload;
91+
}
92+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
3+
namespace AsyncAws\CloudWatchLogs\ValueObject;
4+
5+
use AsyncAws\CloudWatchLogs\Enum\EntityRejectionErrorType;
6+
use AsyncAws\Core\Exception\InvalidArgument;
7+
8+
/**
9+
* Reserved for future use.
10+
*/
11+
final class RejectedEntityInfo
12+
{
13+
/**
14+
* Reserved for future use.
15+
*
16+
* @var EntityRejectionErrorType::*
17+
*/
18+
private $errorType;
19+
20+
/**
21+
* @param array{
22+
* errorType: EntityRejectionErrorType::*,
23+
* } $input
24+
*/
25+
public function __construct(array $input)
26+
{
27+
$this->errorType = $input['errorType'] ?? $this->throwException(new InvalidArgument('Missing required field "errorType".'));
28+
}
29+
30+
/**
31+
* @param array{
32+
* errorType: EntityRejectionErrorType::*,
33+
* }|RejectedEntityInfo $input
34+
*/
35+
public static function create($input): self
36+
{
37+
return $input instanceof self ? $input : new self($input);
38+
}
39+
40+
/**
41+
* @return EntityRejectionErrorType::*
42+
*/
43+
public function getErrorType(): string
44+
{
45+
return $this->errorType;
46+
}
47+
48+
/**
49+
* @return never
50+
*/
51+
private function throwException(\Throwable $exception)
52+
{
53+
throw $exception;
54+
}
55+
}

0 commit comments

Comments
 (0)