Skip to content

Commit debccc4

Browse files
Update generated code (#1874)
* update generated code * Apply suggestions from code review --------- Co-authored-by: Jérémy Derussé <[email protected]>
1 parent 0df69a9 commit debccc4

File tree

6 files changed

+95
-1
lines changed

6 files changed

+95
-1
lines changed

CHANGELOG.md

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

33
## NOT RELEASED
44

5+
### Added
6+
7+
- AWS api-change: Add support for ScaleConfig
8+
- AWS api-change: Added `eu-isoe-west-1` region
9+
510
### Changed
611

712
- Sort exception alphabetically.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
"extra": {
3030
"branch-alias": {
31-
"dev-master": "1.3-dev"
31+
"dev-master": "1.4-dev"
3232
}
3333
}
3434
}

src/ElastiCacheClient.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,13 @@ protected function getEndpointMetadata(?string $region): array
135135
'signService' => 'elasticache',
136136
'signVersions' => ['v4'],
137137
];
138+
case 'eu-isoe-west-1':
139+
return [
140+
'endpoint' => 'https://elasticache.eu-isoe-west-1.cloud.adc-e.uk',
141+
'signRegion' => 'eu-isoe-west-1',
142+
'signService' => 'elasticache',
143+
'signVersions' => ['v4'],
144+
];
138145
case 'us-isob-east-1':
139146
return [
140147
'endpoint' => 'https://elasticache.us-isob-east-1.sc2s.sgov.gov',

src/Result/CacheClusterMessage.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use AsyncAws\ElastiCache\ValueObject\NotificationConfiguration;
2020
use AsyncAws\ElastiCache\ValueObject\PendingLogDeliveryConfiguration;
2121
use AsyncAws\ElastiCache\ValueObject\PendingModifiedValues;
22+
use AsyncAws\ElastiCache\ValueObject\ScaleConfig;
2223
use AsyncAws\ElastiCache\ValueObject\SecurityGroupMembership;
2324

2425
/**
@@ -331,6 +332,15 @@ private function populateResultPendingModifiedValues(\SimpleXMLElement $xml): Pe
331332
'LogDeliveryConfigurations' => (0 === ($v = $xml->LogDeliveryConfigurations)->count()) ? null : $this->populateResultPendingLogDeliveryConfigurationList($v),
332333
'TransitEncryptionEnabled' => (null !== $v = $xml->TransitEncryptionEnabled[0]) ? filter_var((string) $v, \FILTER_VALIDATE_BOOLEAN) : null,
333334
'TransitEncryptionMode' => (null !== $v = $xml->TransitEncryptionMode[0]) ? (string) $v : null,
335+
'ScaleConfig' => 0 === $xml->ScaleConfig->count() ? null : $this->populateResultScaleConfig($xml->ScaleConfig),
336+
]);
337+
}
338+
339+
private function populateResultScaleConfig(\SimpleXMLElement $xml): ScaleConfig
340+
{
341+
return new ScaleConfig([
342+
'ScalePercentage' => (null !== $v = $xml->ScalePercentage[0]) ? (int) (string) $v : null,
343+
'ScaleIntervalMinutes' => (null !== $v = $xml->ScaleIntervalMinutes[0]) ? (int) (string) $v : null,
334344
]);
335345
}
336346

src/ValueObject/PendingModifiedValues.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ final class PendingModifiedValues
7070
*/
7171
private $transitEncryptionMode;
7272

73+
/**
74+
* The scaling configuration changes that are pending for the Memcached cluster.
75+
*
76+
* @var ScaleConfig|null
77+
*/
78+
private $scaleConfig;
79+
7380
/**
7481
* @param array{
7582
* NumCacheNodes?: null|int,
@@ -80,6 +87,7 @@ final class PendingModifiedValues
8087
* LogDeliveryConfigurations?: null|array<PendingLogDeliveryConfiguration|array>,
8188
* TransitEncryptionEnabled?: null|bool,
8289
* TransitEncryptionMode?: null|TransitEncryptionMode::*,
90+
* ScaleConfig?: null|ScaleConfig|array,
8391
* } $input
8492
*/
8593
public function __construct(array $input)
@@ -92,6 +100,7 @@ public function __construct(array $input)
92100
$this->logDeliveryConfigurations = isset($input['LogDeliveryConfigurations']) ? array_map([PendingLogDeliveryConfiguration::class, 'create'], $input['LogDeliveryConfigurations']) : null;
93101
$this->transitEncryptionEnabled = $input['TransitEncryptionEnabled'] ?? null;
94102
$this->transitEncryptionMode = $input['TransitEncryptionMode'] ?? null;
103+
$this->scaleConfig = isset($input['ScaleConfig']) ? ScaleConfig::create($input['ScaleConfig']) : null;
95104
}
96105

97106
/**
@@ -104,6 +113,7 @@ public function __construct(array $input)
104113
* LogDeliveryConfigurations?: null|array<PendingLogDeliveryConfiguration|array>,
105114
* TransitEncryptionEnabled?: null|bool,
106115
* TransitEncryptionMode?: null|TransitEncryptionMode::*,
116+
* ScaleConfig?: null|ScaleConfig|array,
107117
* }|PendingModifiedValues $input
108118
*/
109119
public static function create($input): self
@@ -150,6 +160,11 @@ public function getNumCacheNodes(): ?int
150160
return $this->numCacheNodes;
151161
}
152162

163+
public function getScaleConfig(): ?ScaleConfig
164+
{
165+
return $this->scaleConfig;
166+
}
167+
153168
public function getTransitEncryptionEnabled(): ?bool
154169
{
155170
return $this->transitEncryptionEnabled;

src/ValueObject/ScaleConfig.php

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?php
2+
3+
namespace AsyncAws\ElastiCache\ValueObject;
4+
5+
/**
6+
* Configuration settings for horizontal or vertical scaling operations on Memcached clusters.
7+
*/
8+
final class ScaleConfig
9+
{
10+
/**
11+
* The percentage by which to scale the Memcached cluster, either horizontally by adding nodes or vertically by
12+
* increasing resources.
13+
*
14+
* @var int|null
15+
*/
16+
private $scalePercentage;
17+
18+
/**
19+
* The time interval in seconds between scaling operations when performing gradual scaling for a Memcached cluster.
20+
*
21+
* @var int|null
22+
*/
23+
private $scaleIntervalMinutes;
24+
25+
/**
26+
* @param array{
27+
* ScalePercentage?: null|int,
28+
* ScaleIntervalMinutes?: null|int,
29+
* } $input
30+
*/
31+
public function __construct(array $input)
32+
{
33+
$this->scalePercentage = $input['ScalePercentage'] ?? null;
34+
$this->scaleIntervalMinutes = $input['ScaleIntervalMinutes'] ?? null;
35+
}
36+
37+
/**
38+
* @param array{
39+
* ScalePercentage?: null|int,
40+
* ScaleIntervalMinutes?: null|int,
41+
* }|ScaleConfig $input
42+
*/
43+
public static function create($input): self
44+
{
45+
return $input instanceof self ? $input : new self($input);
46+
}
47+
48+
public function getScaleIntervalMinutes(): ?int
49+
{
50+
return $this->scaleIntervalMinutes;
51+
}
52+
53+
public function getScalePercentage(): ?int
54+
{
55+
return $this->scalePercentage;
56+
}
57+
}

0 commit comments

Comments
 (0)