Skip to content

Commit bc7e9a8

Browse files
Update generated code (#1664)
update generated code
1 parent 8a1f9f6 commit bc7e9a8

14 files changed

+216
-1
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: Adds support for new options on GraphqlAPIs, Resolvers and Data Sources for emitting Amazon CloudWatch metrics for enhanced monitoring of AppSync APIs.
8+
59
## 2.0.1
610

711
### Changed

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": "2.0-dev"
31+
"dev-master": "2.1-dev"
3232
}
3333
}
3434
}

src/AppSyncClient.php

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

33
namespace AsyncAws\AppSync;
44

5+
use AsyncAws\AppSync\Enum\DataSourceLevelMetricsConfig;
56
use AsyncAws\AppSync\Enum\DataSourceType;
67
use AsyncAws\AppSync\Enum\ResolverKind;
8+
use AsyncAws\AppSync\Enum\ResolverLevelMetricsConfig;
79
use AsyncAws\AppSync\Exception\ApiKeyValidityOutOfBoundsException;
810
use AsyncAws\AppSync\Exception\BadRequestException;
911
use AsyncAws\AppSync\Exception\ConcurrentModificationException;
@@ -71,6 +73,7 @@ class AppSyncClient extends AbstractApi
7173
* maxBatchSize?: null|int,
7274
* runtime?: null|AppSyncRuntime|array,
7375
* code?: null|string,
76+
* metricsConfig?: null|ResolverLevelMetricsConfig::*,
7477
* '@region'?: string|null,
7578
* }|CreateResolverRequest $input
7679
*
@@ -312,6 +315,7 @@ public function updateApiKey($input): UpdateApiKeyResponse
312315
* httpConfig?: null|HttpDataSourceConfig|array,
313316
* relationalDatabaseConfig?: null|RelationalDatabaseDataSourceConfig|array,
314317
* eventBridgeConfig?: null|EventBridgeDataSourceConfig|array,
318+
* metricsConfig?: null|DataSourceLevelMetricsConfig::*,
315319
* '@region'?: string|null,
316320
* }|UpdateDataSourceRequest $input
317321
*
@@ -355,6 +359,7 @@ public function updateDataSource($input): UpdateDataSourceResponse
355359
* maxBatchSize?: null|int,
356360
* runtime?: null|AppSyncRuntime|array,
357361
* code?: null|string,
362+
* metricsConfig?: null|ResolverLevelMetricsConfig::*,
358363
* '@region'?: string|null,
359364
* }|UpdateResolverRequest $input
360365
*
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace AsyncAws\AppSync\Enum;
4+
5+
final class DataSourceLevelMetricsConfig
6+
{
7+
public const DISABLED = 'DISABLED';
8+
public const ENABLED = 'ENABLED';
9+
10+
public static function exists(string $value): bool
11+
{
12+
return isset([
13+
self::DISABLED => true,
14+
self::ENABLED => true,
15+
][$value]);
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace AsyncAws\AppSync\Enum;
4+
5+
final class ResolverLevelMetricsConfig
6+
{
7+
public const DISABLED = 'DISABLED';
8+
public const ENABLED = 'ENABLED';
9+
10+
public static function exists(string $value): bool
11+
{
12+
return isset([
13+
self::DISABLED => true,
14+
self::ENABLED => true,
15+
][$value]);
16+
}
17+
}

src/Input/CreateResolverRequest.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace AsyncAws\AppSync\Input;
44

55
use AsyncAws\AppSync\Enum\ResolverKind;
6+
use AsyncAws\AppSync\Enum\ResolverLevelMetricsConfig;
67
use AsyncAws\AppSync\ValueObject\AppSyncRuntime;
78
use AsyncAws\AppSync\ValueObject\CachingConfig;
89
use AsyncAws\AppSync\ValueObject\PipelineConfig;
@@ -121,6 +122,18 @@ final class CreateResolverRequest extends Input
121122
*/
122123
private $code;
123124

125+
/**
126+
* Enables or disables enhanced resolver metrics for specified resolvers. Note that `metricsConfig` won't be used unless
127+
* the `resolverLevelMetricsBehavior` value is set to `PER_RESOLVER_METRICS`. If the `resolverLevelMetricsBehavior` is
128+
* set to `FULL_REQUEST_RESOLVER_METRICS` instead, `metricsConfig` will be ignored. However, you can still set its
129+
* value.
130+
*
131+
* `metricsConfig` can be `ENABLED` or `DISABLED`.
132+
*
133+
* @var ResolverLevelMetricsConfig::*|null
134+
*/
135+
private $metricsConfig;
136+
124137
/**
125138
* @param array{
126139
* apiId?: string,
@@ -136,6 +149,7 @@ final class CreateResolverRequest extends Input
136149
* maxBatchSize?: null|int,
137150
* runtime?: null|AppSyncRuntime|array,
138151
* code?: null|string,
152+
* metricsConfig?: null|ResolverLevelMetricsConfig::*,
139153
* '@region'?: string|null,
140154
* } $input
141155
*/
@@ -154,6 +168,7 @@ public function __construct(array $input = [])
154168
$this->maxBatchSize = $input['maxBatchSize'] ?? null;
155169
$this->runtime = isset($input['runtime']) ? AppSyncRuntime::create($input['runtime']) : null;
156170
$this->code = $input['code'] ?? null;
171+
$this->metricsConfig = $input['metricsConfig'] ?? null;
157172
parent::__construct($input);
158173
}
159174

@@ -172,6 +187,7 @@ public function __construct(array $input = [])
172187
* maxBatchSize?: null|int,
173188
* runtime?: null|AppSyncRuntime|array,
174189
* code?: null|string,
190+
* metricsConfig?: null|ResolverLevelMetricsConfig::*,
175191
* '@region'?: string|null,
176192
* }|CreateResolverRequest $input
177193
*/
@@ -218,6 +234,14 @@ public function getMaxBatchSize(): ?int
218234
return $this->maxBatchSize;
219235
}
220236

237+
/**
238+
* @return ResolverLevelMetricsConfig::*|null
239+
*/
240+
public function getMetricsConfig(): ?string
241+
{
242+
return $this->metricsConfig;
243+
}
244+
221245
public function getPipelineConfig(): ?PipelineConfig
222246
{
223247
return $this->pipelineConfig;
@@ -331,6 +355,16 @@ public function setMaxBatchSize(?int $value): self
331355
return $this;
332356
}
333357

358+
/**
359+
* @param ResolverLevelMetricsConfig::*|null $value
360+
*/
361+
public function setMetricsConfig(?string $value): self
362+
{
363+
$this->metricsConfig = $value;
364+
365+
return $this;
366+
}
367+
334368
public function setPipelineConfig(?PipelineConfig $value): self
335369
{
336370
$this->pipelineConfig = $value;
@@ -414,6 +448,12 @@ private function requestBody(): array
414448
if (null !== $v = $this->code) {
415449
$payload['code'] = $v;
416450
}
451+
if (null !== $v = $this->metricsConfig) {
452+
if (!ResolverLevelMetricsConfig::exists($v)) {
453+
throw new InvalidArgument(sprintf('Invalid parameter "metricsConfig" for "%s". The value "%s" is not a valid "ResolverLevelMetricsConfig".', __CLASS__, $v));
454+
}
455+
$payload['metricsConfig'] = $v;
456+
}
417457

418458
return $payload;
419459
}

src/Input/UpdateDataSourceRequest.php

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

33
namespace AsyncAws\AppSync\Input;
44

5+
use AsyncAws\AppSync\Enum\DataSourceLevelMetricsConfig;
56
use AsyncAws\AppSync\Enum\DataSourceType;
67
use AsyncAws\AppSync\ValueObject\DynamodbDataSourceConfig;
78
use AsyncAws\AppSync\ValueObject\ElasticsearchDataSourceConfig;
@@ -110,6 +111,18 @@ final class UpdateDataSourceRequest extends Input
110111
*/
111112
private $eventBridgeConfig;
112113

114+
/**
115+
* Enables or disables enhanced data source metrics for specified data sources. Note that `metricsConfig` won't be used
116+
* unless the `dataSourceLevelMetricsBehavior` value is set to `PER_DATA_SOURCE_METRICS`. If the
117+
* `dataSourceLevelMetricsBehavior` is set to `FULL_REQUEST_DATA_SOURCE_METRICS` instead, `metricsConfig` will be
118+
* ignored. However, you can still set its value.
119+
*
120+
* `metricsConfig` can be `ENABLED` or `DISABLED`.
121+
*
122+
* @var DataSourceLevelMetricsConfig::*|null
123+
*/
124+
private $metricsConfig;
125+
113126
/**
114127
* @param array{
115128
* apiId?: string,
@@ -124,6 +137,7 @@ final class UpdateDataSourceRequest extends Input
124137
* httpConfig?: null|HttpDataSourceConfig|array,
125138
* relationalDatabaseConfig?: null|RelationalDatabaseDataSourceConfig|array,
126139
* eventBridgeConfig?: null|EventBridgeDataSourceConfig|array,
140+
* metricsConfig?: null|DataSourceLevelMetricsConfig::*,
127141
* '@region'?: string|null,
128142
* } $input
129143
*/
@@ -141,6 +155,7 @@ public function __construct(array $input = [])
141155
$this->httpConfig = isset($input['httpConfig']) ? HttpDataSourceConfig::create($input['httpConfig']) : null;
142156
$this->relationalDatabaseConfig = isset($input['relationalDatabaseConfig']) ? RelationalDatabaseDataSourceConfig::create($input['relationalDatabaseConfig']) : null;
143157
$this->eventBridgeConfig = isset($input['eventBridgeConfig']) ? EventBridgeDataSourceConfig::create($input['eventBridgeConfig']) : null;
158+
$this->metricsConfig = $input['metricsConfig'] ?? null;
144159
parent::__construct($input);
145160
}
146161

@@ -158,6 +173,7 @@ public function __construct(array $input = [])
158173
* httpConfig?: null|HttpDataSourceConfig|array,
159174
* relationalDatabaseConfig?: null|RelationalDatabaseDataSourceConfig|array,
160175
* eventBridgeConfig?: null|EventBridgeDataSourceConfig|array,
176+
* metricsConfig?: null|DataSourceLevelMetricsConfig::*,
161177
* '@region'?: string|null,
162178
* }|UpdateDataSourceRequest $input
163179
*/
@@ -201,6 +217,14 @@ public function getLambdaConfig(): ?LambdaDataSourceConfig
201217
return $this->lambdaConfig;
202218
}
203219

220+
/**
221+
* @return DataSourceLevelMetricsConfig::*|null
222+
*/
223+
public function getMetricsConfig(): ?string
224+
{
225+
return $this->metricsConfig;
226+
}
227+
204228
public function getName(): ?string
205229
{
206230
return $this->name;
@@ -309,6 +333,16 @@ public function setLambdaConfig(?LambdaDataSourceConfig $value): self
309333
return $this;
310334
}
311335

336+
/**
337+
* @param DataSourceLevelMetricsConfig::*|null $value
338+
*/
339+
public function setMetricsConfig(?string $value): self
340+
{
341+
$this->metricsConfig = $value;
342+
343+
return $this;
344+
}
345+
312346
public function setName(?string $value): self
313347
{
314348
$this->name = $value;
@@ -385,6 +419,12 @@ private function requestBody(): array
385419
if (null !== $v = $this->eventBridgeConfig) {
386420
$payload['eventBridgeConfig'] = $v->requestBody();
387421
}
422+
if (null !== $v = $this->metricsConfig) {
423+
if (!DataSourceLevelMetricsConfig::exists($v)) {
424+
throw new InvalidArgument(sprintf('Invalid parameter "metricsConfig" for "%s". The value "%s" is not a valid "DataSourceLevelMetricsConfig".', __CLASS__, $v));
425+
}
426+
$payload['metricsConfig'] = $v;
427+
}
388428

389429
return $payload;
390430
}

src/Input/UpdateResolverRequest.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace AsyncAws\AppSync\Input;
44

55
use AsyncAws\AppSync\Enum\ResolverKind;
6+
use AsyncAws\AppSync\Enum\ResolverLevelMetricsConfig;
67
use AsyncAws\AppSync\ValueObject\AppSyncRuntime;
78
use AsyncAws\AppSync\ValueObject\CachingConfig;
89
use AsyncAws\AppSync\ValueObject\PipelineConfig;
@@ -121,6 +122,18 @@ final class UpdateResolverRequest extends Input
121122
*/
122123
private $code;
123124

125+
/**
126+
* Enables or disables enhanced resolver metrics for specified resolvers. Note that `metricsConfig` won't be used unless
127+
* the `resolverLevelMetricsBehavior` value is set to `PER_RESOLVER_METRICS`. If the `resolverLevelMetricsBehavior` is
128+
* set to `FULL_REQUEST_RESOLVER_METRICS` instead, `metricsConfig` will be ignored. However, you can still set its
129+
* value.
130+
*
131+
* `metricsConfig` can be `ENABLED` or `DISABLED`.
132+
*
133+
* @var ResolverLevelMetricsConfig::*|null
134+
*/
135+
private $metricsConfig;
136+
124137
/**
125138
* @param array{
126139
* apiId?: string,
@@ -136,6 +149,7 @@ final class UpdateResolverRequest extends Input
136149
* maxBatchSize?: null|int,
137150
* runtime?: null|AppSyncRuntime|array,
138151
* code?: null|string,
152+
* metricsConfig?: null|ResolverLevelMetricsConfig::*,
139153
* '@region'?: string|null,
140154
* } $input
141155
*/
@@ -154,6 +168,7 @@ public function __construct(array $input = [])
154168
$this->maxBatchSize = $input['maxBatchSize'] ?? null;
155169
$this->runtime = isset($input['runtime']) ? AppSyncRuntime::create($input['runtime']) : null;
156170
$this->code = $input['code'] ?? null;
171+
$this->metricsConfig = $input['metricsConfig'] ?? null;
157172
parent::__construct($input);
158173
}
159174

@@ -172,6 +187,7 @@ public function __construct(array $input = [])
172187
* maxBatchSize?: null|int,
173188
* runtime?: null|AppSyncRuntime|array,
174189
* code?: null|string,
190+
* metricsConfig?: null|ResolverLevelMetricsConfig::*,
175191
* '@region'?: string|null,
176192
* }|UpdateResolverRequest $input
177193
*/
@@ -218,6 +234,14 @@ public function getMaxBatchSize(): ?int
218234
return $this->maxBatchSize;
219235
}
220236

237+
/**
238+
* @return ResolverLevelMetricsConfig::*|null
239+
*/
240+
public function getMetricsConfig(): ?string
241+
{
242+
return $this->metricsConfig;
243+
}
244+
221245
public function getPipelineConfig(): ?PipelineConfig
222246
{
223247
return $this->pipelineConfig;
@@ -335,6 +359,16 @@ public function setMaxBatchSize(?int $value): self
335359
return $this;
336360
}
337361

362+
/**
363+
* @param ResolverLevelMetricsConfig::*|null $value
364+
*/
365+
public function setMetricsConfig(?string $value): self
366+
{
367+
$this->metricsConfig = $value;
368+
369+
return $this;
370+
}
371+
338372
public function setPipelineConfig(?PipelineConfig $value): self
339373
{
340374
$this->pipelineConfig = $value;
@@ -414,6 +448,12 @@ private function requestBody(): array
414448
if (null !== $v = $this->code) {
415449
$payload['code'] = $v;
416450
}
451+
if (null !== $v = $this->metricsConfig) {
452+
if (!ResolverLevelMetricsConfig::exists($v)) {
453+
throw new InvalidArgument(sprintf('Invalid parameter "metricsConfig" for "%s". The value "%s" is not a valid "ResolverLevelMetricsConfig".', __CLASS__, $v));
454+
}
455+
$payload['metricsConfig'] = $v;
456+
}
417457

418458
return $payload;
419459
}

src/Result/CreateResolverResponse.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ private function populateResultResolver(array $json): Resolver
112112
'maxBatchSize' => isset($json['maxBatchSize']) ? (int) $json['maxBatchSize'] : null,
113113
'runtime' => empty($json['runtime']) ? null : $this->populateResultAppSyncRuntime($json['runtime']),
114114
'code' => isset($json['code']) ? (string) $json['code'] : null,
115+
'metricsConfig' => isset($json['metricsConfig']) ? (string) $json['metricsConfig'] : null,
115116
]);
116117
}
117118

src/Result/ListResolversResponse.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ private function populateResultResolver(array $json): Resolver
130130
'maxBatchSize' => isset($json['maxBatchSize']) ? (int) $json['maxBatchSize'] : null,
131131
'runtime' => empty($json['runtime']) ? null : $this->populateResultAppSyncRuntime($json['runtime']),
132132
'code' => isset($json['code']) ? (string) $json['code'] : null,
133+
'metricsConfig' => isset($json['metricsConfig']) ? (string) $json['metricsConfig'] : null,
133134
]);
134135
}
135136

0 commit comments

Comments
 (0)