From bc7e9a842195003f0c2381c895e0d1c67973ac1e Mon Sep 17 00:00:00 2001 From: AsyncAws <61784373+async-aws-bot@users.noreply.github.com> Date: Mon, 12 Feb 2024 23:33:08 -0800 Subject: [PATCH] Update generated code (#1664) update generated code --- CHANGELOG.md | 4 +++ composer.json | 2 +- src/AppSyncClient.php | 5 +++ src/Enum/DataSourceLevelMetricsConfig.php | 17 ++++++++++ src/Enum/ResolverLevelMetricsConfig.php | 17 ++++++++++ src/Input/CreateResolverRequest.php | 40 +++++++++++++++++++++++ src/Input/UpdateDataSourceRequest.php | 40 +++++++++++++++++++++++ src/Input/UpdateResolverRequest.php | 40 +++++++++++++++++++++++ src/Result/CreateResolverResponse.php | 1 + src/Result/ListResolversResponse.php | 1 + src/Result/UpdateDataSourceResponse.php | 1 + src/Result/UpdateResolverResponse.php | 1 + src/ValueObject/DataSource.php | 24 ++++++++++++++ src/ValueObject/Resolver.php | 24 ++++++++++++++ 14 files changed, 216 insertions(+), 1 deletion(-) create mode 100644 src/Enum/DataSourceLevelMetricsConfig.php create mode 100644 src/Enum/ResolverLevelMetricsConfig.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 21ae0dd..4a0d47d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Added + +- 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. + ## 2.0.1 ### Changed diff --git a/composer.json b/composer.json index 5d1a37f..05a0867 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ }, "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "2.1-dev" } } } diff --git a/src/AppSyncClient.php b/src/AppSyncClient.php index af416eb..0686b34 100644 --- a/src/AppSyncClient.php +++ b/src/AppSyncClient.php @@ -2,8 +2,10 @@ namespace AsyncAws\AppSync; +use AsyncAws\AppSync\Enum\DataSourceLevelMetricsConfig; use AsyncAws\AppSync\Enum\DataSourceType; use AsyncAws\AppSync\Enum\ResolverKind; +use AsyncAws\AppSync\Enum\ResolverLevelMetricsConfig; use AsyncAws\AppSync\Exception\ApiKeyValidityOutOfBoundsException; use AsyncAws\AppSync\Exception\BadRequestException; use AsyncAws\AppSync\Exception\ConcurrentModificationException; @@ -71,6 +73,7 @@ class AppSyncClient extends AbstractApi * maxBatchSize?: null|int, * runtime?: null|AppSyncRuntime|array, * code?: null|string, + * metricsConfig?: null|ResolverLevelMetricsConfig::*, * '@region'?: string|null, * }|CreateResolverRequest $input * @@ -312,6 +315,7 @@ public function updateApiKey($input): UpdateApiKeyResponse * httpConfig?: null|HttpDataSourceConfig|array, * relationalDatabaseConfig?: null|RelationalDatabaseDataSourceConfig|array, * eventBridgeConfig?: null|EventBridgeDataSourceConfig|array, + * metricsConfig?: null|DataSourceLevelMetricsConfig::*, * '@region'?: string|null, * }|UpdateDataSourceRequest $input * @@ -355,6 +359,7 @@ public function updateDataSource($input): UpdateDataSourceResponse * maxBatchSize?: null|int, * runtime?: null|AppSyncRuntime|array, * code?: null|string, + * metricsConfig?: null|ResolverLevelMetricsConfig::*, * '@region'?: string|null, * }|UpdateResolverRequest $input * diff --git a/src/Enum/DataSourceLevelMetricsConfig.php b/src/Enum/DataSourceLevelMetricsConfig.php new file mode 100644 index 0000000..3574010 --- /dev/null +++ b/src/Enum/DataSourceLevelMetricsConfig.php @@ -0,0 +1,17 @@ + true, + self::ENABLED => true, + ][$value]); + } +} diff --git a/src/Enum/ResolverLevelMetricsConfig.php b/src/Enum/ResolverLevelMetricsConfig.php new file mode 100644 index 0000000..0fbe40e --- /dev/null +++ b/src/Enum/ResolverLevelMetricsConfig.php @@ -0,0 +1,17 @@ + true, + self::ENABLED => true, + ][$value]); + } +} diff --git a/src/Input/CreateResolverRequest.php b/src/Input/CreateResolverRequest.php index a0ca025..2ab25f2 100644 --- a/src/Input/CreateResolverRequest.php +++ b/src/Input/CreateResolverRequest.php @@ -3,6 +3,7 @@ namespace AsyncAws\AppSync\Input; use AsyncAws\AppSync\Enum\ResolverKind; +use AsyncAws\AppSync\Enum\ResolverLevelMetricsConfig; use AsyncAws\AppSync\ValueObject\AppSyncRuntime; use AsyncAws\AppSync\ValueObject\CachingConfig; use AsyncAws\AppSync\ValueObject\PipelineConfig; @@ -121,6 +122,18 @@ final class CreateResolverRequest extends Input */ private $code; + /** + * Enables or disables enhanced resolver metrics for specified resolvers. Note that `metricsConfig` won't be used unless + * the `resolverLevelMetricsBehavior` value is set to `PER_RESOLVER_METRICS`. If the `resolverLevelMetricsBehavior` is + * set to `FULL_REQUEST_RESOLVER_METRICS` instead, `metricsConfig` will be ignored. However, you can still set its + * value. + * + * `metricsConfig` can be `ENABLED` or `DISABLED`. + * + * @var ResolverLevelMetricsConfig::*|null + */ + private $metricsConfig; + /** * @param array{ * apiId?: string, @@ -136,6 +149,7 @@ final class CreateResolverRequest extends Input * maxBatchSize?: null|int, * runtime?: null|AppSyncRuntime|array, * code?: null|string, + * metricsConfig?: null|ResolverLevelMetricsConfig::*, * '@region'?: string|null, * } $input */ @@ -154,6 +168,7 @@ public function __construct(array $input = []) $this->maxBatchSize = $input['maxBatchSize'] ?? null; $this->runtime = isset($input['runtime']) ? AppSyncRuntime::create($input['runtime']) : null; $this->code = $input['code'] ?? null; + $this->metricsConfig = $input['metricsConfig'] ?? null; parent::__construct($input); } @@ -172,6 +187,7 @@ public function __construct(array $input = []) * maxBatchSize?: null|int, * runtime?: null|AppSyncRuntime|array, * code?: null|string, + * metricsConfig?: null|ResolverLevelMetricsConfig::*, * '@region'?: string|null, * }|CreateResolverRequest $input */ @@ -218,6 +234,14 @@ public function getMaxBatchSize(): ?int return $this->maxBatchSize; } + /** + * @return ResolverLevelMetricsConfig::*|null + */ + public function getMetricsConfig(): ?string + { + return $this->metricsConfig; + } + public function getPipelineConfig(): ?PipelineConfig { return $this->pipelineConfig; @@ -331,6 +355,16 @@ public function setMaxBatchSize(?int $value): self return $this; } + /** + * @param ResolverLevelMetricsConfig::*|null $value + */ + public function setMetricsConfig(?string $value): self + { + $this->metricsConfig = $value; + + return $this; + } + public function setPipelineConfig(?PipelineConfig $value): self { $this->pipelineConfig = $value; @@ -414,6 +448,12 @@ private function requestBody(): array if (null !== $v = $this->code) { $payload['code'] = $v; } + if (null !== $v = $this->metricsConfig) { + if (!ResolverLevelMetricsConfig::exists($v)) { + throw new InvalidArgument(sprintf('Invalid parameter "metricsConfig" for "%s". The value "%s" is not a valid "ResolverLevelMetricsConfig".', __CLASS__, $v)); + } + $payload['metricsConfig'] = $v; + } return $payload; } diff --git a/src/Input/UpdateDataSourceRequest.php b/src/Input/UpdateDataSourceRequest.php index f62a6cf..744e347 100644 --- a/src/Input/UpdateDataSourceRequest.php +++ b/src/Input/UpdateDataSourceRequest.php @@ -2,6 +2,7 @@ namespace AsyncAws\AppSync\Input; +use AsyncAws\AppSync\Enum\DataSourceLevelMetricsConfig; use AsyncAws\AppSync\Enum\DataSourceType; use AsyncAws\AppSync\ValueObject\DynamodbDataSourceConfig; use AsyncAws\AppSync\ValueObject\ElasticsearchDataSourceConfig; @@ -110,6 +111,18 @@ final class UpdateDataSourceRequest extends Input */ private $eventBridgeConfig; + /** + * Enables or disables enhanced data source metrics for specified data sources. Note that `metricsConfig` won't be used + * unless the `dataSourceLevelMetricsBehavior` value is set to `PER_DATA_SOURCE_METRICS`. If the + * `dataSourceLevelMetricsBehavior` is set to `FULL_REQUEST_DATA_SOURCE_METRICS` instead, `metricsConfig` will be + * ignored. However, you can still set its value. + * + * `metricsConfig` can be `ENABLED` or `DISABLED`. + * + * @var DataSourceLevelMetricsConfig::*|null + */ + private $metricsConfig; + /** * @param array{ * apiId?: string, @@ -124,6 +137,7 @@ final class UpdateDataSourceRequest extends Input * httpConfig?: null|HttpDataSourceConfig|array, * relationalDatabaseConfig?: null|RelationalDatabaseDataSourceConfig|array, * eventBridgeConfig?: null|EventBridgeDataSourceConfig|array, + * metricsConfig?: null|DataSourceLevelMetricsConfig::*, * '@region'?: string|null, * } $input */ @@ -141,6 +155,7 @@ public function __construct(array $input = []) $this->httpConfig = isset($input['httpConfig']) ? HttpDataSourceConfig::create($input['httpConfig']) : null; $this->relationalDatabaseConfig = isset($input['relationalDatabaseConfig']) ? RelationalDatabaseDataSourceConfig::create($input['relationalDatabaseConfig']) : null; $this->eventBridgeConfig = isset($input['eventBridgeConfig']) ? EventBridgeDataSourceConfig::create($input['eventBridgeConfig']) : null; + $this->metricsConfig = $input['metricsConfig'] ?? null; parent::__construct($input); } @@ -158,6 +173,7 @@ public function __construct(array $input = []) * httpConfig?: null|HttpDataSourceConfig|array, * relationalDatabaseConfig?: null|RelationalDatabaseDataSourceConfig|array, * eventBridgeConfig?: null|EventBridgeDataSourceConfig|array, + * metricsConfig?: null|DataSourceLevelMetricsConfig::*, * '@region'?: string|null, * }|UpdateDataSourceRequest $input */ @@ -201,6 +217,14 @@ public function getLambdaConfig(): ?LambdaDataSourceConfig return $this->lambdaConfig; } + /** + * @return DataSourceLevelMetricsConfig::*|null + */ + public function getMetricsConfig(): ?string + { + return $this->metricsConfig; + } + public function getName(): ?string { return $this->name; @@ -309,6 +333,16 @@ public function setLambdaConfig(?LambdaDataSourceConfig $value): self return $this; } + /** + * @param DataSourceLevelMetricsConfig::*|null $value + */ + public function setMetricsConfig(?string $value): self + { + $this->metricsConfig = $value; + + return $this; + } + public function setName(?string $value): self { $this->name = $value; @@ -385,6 +419,12 @@ private function requestBody(): array if (null !== $v = $this->eventBridgeConfig) { $payload['eventBridgeConfig'] = $v->requestBody(); } + if (null !== $v = $this->metricsConfig) { + if (!DataSourceLevelMetricsConfig::exists($v)) { + throw new InvalidArgument(sprintf('Invalid parameter "metricsConfig" for "%s". The value "%s" is not a valid "DataSourceLevelMetricsConfig".', __CLASS__, $v)); + } + $payload['metricsConfig'] = $v; + } return $payload; } diff --git a/src/Input/UpdateResolverRequest.php b/src/Input/UpdateResolverRequest.php index 8c629a6..2ec6d2b 100644 --- a/src/Input/UpdateResolverRequest.php +++ b/src/Input/UpdateResolverRequest.php @@ -3,6 +3,7 @@ namespace AsyncAws\AppSync\Input; use AsyncAws\AppSync\Enum\ResolverKind; +use AsyncAws\AppSync\Enum\ResolverLevelMetricsConfig; use AsyncAws\AppSync\ValueObject\AppSyncRuntime; use AsyncAws\AppSync\ValueObject\CachingConfig; use AsyncAws\AppSync\ValueObject\PipelineConfig; @@ -121,6 +122,18 @@ final class UpdateResolverRequest extends Input */ private $code; + /** + * Enables or disables enhanced resolver metrics for specified resolvers. Note that `metricsConfig` won't be used unless + * the `resolverLevelMetricsBehavior` value is set to `PER_RESOLVER_METRICS`. If the `resolverLevelMetricsBehavior` is + * set to `FULL_REQUEST_RESOLVER_METRICS` instead, `metricsConfig` will be ignored. However, you can still set its + * value. + * + * `metricsConfig` can be `ENABLED` or `DISABLED`. + * + * @var ResolverLevelMetricsConfig::*|null + */ + private $metricsConfig; + /** * @param array{ * apiId?: string, @@ -136,6 +149,7 @@ final class UpdateResolverRequest extends Input * maxBatchSize?: null|int, * runtime?: null|AppSyncRuntime|array, * code?: null|string, + * metricsConfig?: null|ResolverLevelMetricsConfig::*, * '@region'?: string|null, * } $input */ @@ -154,6 +168,7 @@ public function __construct(array $input = []) $this->maxBatchSize = $input['maxBatchSize'] ?? null; $this->runtime = isset($input['runtime']) ? AppSyncRuntime::create($input['runtime']) : null; $this->code = $input['code'] ?? null; + $this->metricsConfig = $input['metricsConfig'] ?? null; parent::__construct($input); } @@ -172,6 +187,7 @@ public function __construct(array $input = []) * maxBatchSize?: null|int, * runtime?: null|AppSyncRuntime|array, * code?: null|string, + * metricsConfig?: null|ResolverLevelMetricsConfig::*, * '@region'?: string|null, * }|UpdateResolverRequest $input */ @@ -218,6 +234,14 @@ public function getMaxBatchSize(): ?int return $this->maxBatchSize; } + /** + * @return ResolverLevelMetricsConfig::*|null + */ + public function getMetricsConfig(): ?string + { + return $this->metricsConfig; + } + public function getPipelineConfig(): ?PipelineConfig { return $this->pipelineConfig; @@ -335,6 +359,16 @@ public function setMaxBatchSize(?int $value): self return $this; } + /** + * @param ResolverLevelMetricsConfig::*|null $value + */ + public function setMetricsConfig(?string $value): self + { + $this->metricsConfig = $value; + + return $this; + } + public function setPipelineConfig(?PipelineConfig $value): self { $this->pipelineConfig = $value; @@ -414,6 +448,12 @@ private function requestBody(): array if (null !== $v = $this->code) { $payload['code'] = $v; } + if (null !== $v = $this->metricsConfig) { + if (!ResolverLevelMetricsConfig::exists($v)) { + throw new InvalidArgument(sprintf('Invalid parameter "metricsConfig" for "%s". The value "%s" is not a valid "ResolverLevelMetricsConfig".', __CLASS__, $v)); + } + $payload['metricsConfig'] = $v; + } return $payload; } diff --git a/src/Result/CreateResolverResponse.php b/src/Result/CreateResolverResponse.php index 0f40ad1..06ae2c6 100644 --- a/src/Result/CreateResolverResponse.php +++ b/src/Result/CreateResolverResponse.php @@ -112,6 +112,7 @@ private function populateResultResolver(array $json): Resolver 'maxBatchSize' => isset($json['maxBatchSize']) ? (int) $json['maxBatchSize'] : null, 'runtime' => empty($json['runtime']) ? null : $this->populateResultAppSyncRuntime($json['runtime']), 'code' => isset($json['code']) ? (string) $json['code'] : null, + 'metricsConfig' => isset($json['metricsConfig']) ? (string) $json['metricsConfig'] : null, ]); } diff --git a/src/Result/ListResolversResponse.php b/src/Result/ListResolversResponse.php index f303b29..6bf132c 100644 --- a/src/Result/ListResolversResponse.php +++ b/src/Result/ListResolversResponse.php @@ -130,6 +130,7 @@ private function populateResultResolver(array $json): Resolver 'maxBatchSize' => isset($json['maxBatchSize']) ? (int) $json['maxBatchSize'] : null, 'runtime' => empty($json['runtime']) ? null : $this->populateResultAppSyncRuntime($json['runtime']), 'code' => isset($json['code']) ? (string) $json['code'] : null, + 'metricsConfig' => isset($json['metricsConfig']) ? (string) $json['metricsConfig'] : null, ]); } diff --git a/src/Result/UpdateDataSourceResponse.php b/src/Result/UpdateDataSourceResponse.php index 24c322c..6a627f0 100644 --- a/src/Result/UpdateDataSourceResponse.php +++ b/src/Result/UpdateDataSourceResponse.php @@ -71,6 +71,7 @@ private function populateResultDataSource(array $json): DataSource 'httpConfig' => empty($json['httpConfig']) ? null : $this->populateResultHttpDataSourceConfig($json['httpConfig']), 'relationalDatabaseConfig' => empty($json['relationalDatabaseConfig']) ? null : $this->populateResultRelationalDatabaseDataSourceConfig($json['relationalDatabaseConfig']), 'eventBridgeConfig' => empty($json['eventBridgeConfig']) ? null : $this->populateResultEventBridgeDataSourceConfig($json['eventBridgeConfig']), + 'metricsConfig' => isset($json['metricsConfig']) ? (string) $json['metricsConfig'] : null, ]); } diff --git a/src/Result/UpdateResolverResponse.php b/src/Result/UpdateResolverResponse.php index 44e8d24..953e48b 100644 --- a/src/Result/UpdateResolverResponse.php +++ b/src/Result/UpdateResolverResponse.php @@ -112,6 +112,7 @@ private function populateResultResolver(array $json): Resolver 'maxBatchSize' => isset($json['maxBatchSize']) ? (int) $json['maxBatchSize'] : null, 'runtime' => empty($json['runtime']) ? null : $this->populateResultAppSyncRuntime($json['runtime']), 'code' => isset($json['code']) ? (string) $json['code'] : null, + 'metricsConfig' => isset($json['metricsConfig']) ? (string) $json['metricsConfig'] : null, ]); } diff --git a/src/ValueObject/DataSource.php b/src/ValueObject/DataSource.php index ea0edcc..b5707f6 100644 --- a/src/ValueObject/DataSource.php +++ b/src/ValueObject/DataSource.php @@ -2,6 +2,7 @@ namespace AsyncAws\AppSync\ValueObject; +use AsyncAws\AppSync\Enum\DataSourceLevelMetricsConfig; use AsyncAws\AppSync\Enum\DataSourceType; /** @@ -105,6 +106,18 @@ final class DataSource */ private $eventBridgeConfig; + /** + * Enables or disables enhanced data source metrics for specified data sources. Note that `metricsConfig` won't be used + * unless the `dataSourceLevelMetricsBehavior` value is set to `PER_DATA_SOURCE_METRICS`. If the + * `dataSourceLevelMetricsBehavior` is set to `FULL_REQUEST_DATA_SOURCE_METRICS` instead, `metricsConfig` will be + * ignored. However, you can still set its value. + * + * `metricsConfig` can be `ENABLED` or `DISABLED`. + * + * @var DataSourceLevelMetricsConfig::*|null + */ + private $metricsConfig; + /** * @param array{ * dataSourceArn?: null|string, @@ -119,6 +132,7 @@ final class DataSource * httpConfig?: null|HttpDataSourceConfig|array, * relationalDatabaseConfig?: null|RelationalDatabaseDataSourceConfig|array, * eventBridgeConfig?: null|EventBridgeDataSourceConfig|array, + * metricsConfig?: null|DataSourceLevelMetricsConfig::*, * } $input */ public function __construct(array $input) @@ -135,6 +149,7 @@ public function __construct(array $input) $this->httpConfig = isset($input['httpConfig']) ? HttpDataSourceConfig::create($input['httpConfig']) : null; $this->relationalDatabaseConfig = isset($input['relationalDatabaseConfig']) ? RelationalDatabaseDataSourceConfig::create($input['relationalDatabaseConfig']) : null; $this->eventBridgeConfig = isset($input['eventBridgeConfig']) ? EventBridgeDataSourceConfig::create($input['eventBridgeConfig']) : null; + $this->metricsConfig = $input['metricsConfig'] ?? null; } /** @@ -151,6 +166,7 @@ public function __construct(array $input) * httpConfig?: null|HttpDataSourceConfig|array, * relationalDatabaseConfig?: null|RelationalDatabaseDataSourceConfig|array, * eventBridgeConfig?: null|EventBridgeDataSourceConfig|array, + * metricsConfig?: null|DataSourceLevelMetricsConfig::*, * }|DataSource $input */ public static function create($input): self @@ -193,6 +209,14 @@ public function getLambdaConfig(): ?LambdaDataSourceConfig return $this->lambdaConfig; } + /** + * @return DataSourceLevelMetricsConfig::*|null + */ + public function getMetricsConfig(): ?string + { + return $this->metricsConfig; + } + public function getName(): ?string { return $this->name; diff --git a/src/ValueObject/Resolver.php b/src/ValueObject/Resolver.php index fd183f7..17f61af 100644 --- a/src/ValueObject/Resolver.php +++ b/src/ValueObject/Resolver.php @@ -3,6 +3,7 @@ namespace AsyncAws\AppSync\ValueObject; use AsyncAws\AppSync\Enum\ResolverKind; +use AsyncAws\AppSync\Enum\ResolverLevelMetricsConfig; /** * Describes a resolver. @@ -104,6 +105,18 @@ final class Resolver */ private $code; + /** + * Enables or disables enhanced resolver metrics for specified resolvers. Note that `metricsConfig` won't be used unless + * the `resolverLevelMetricsBehavior` value is set to `PER_RESOLVER_METRICS`. If the `resolverLevelMetricsBehavior` is + * set to `FULL_REQUEST_RESOLVER_METRICS` instead, `metricsConfig` will be ignored. However, you can still set its + * value. + * + * `metricsConfig` can be `ENABLED` or `DISABLED`. + * + * @var ResolverLevelMetricsConfig::*|null + */ + private $metricsConfig; + /** * @param array{ * typeName?: null|string, @@ -119,6 +132,7 @@ final class Resolver * maxBatchSize?: null|int, * runtime?: null|AppSyncRuntime|array, * code?: null|string, + * metricsConfig?: null|ResolverLevelMetricsConfig::*, * } $input */ public function __construct(array $input) @@ -136,6 +150,7 @@ public function __construct(array $input) $this->maxBatchSize = $input['maxBatchSize'] ?? null; $this->runtime = isset($input['runtime']) ? AppSyncRuntime::create($input['runtime']) : null; $this->code = $input['code'] ?? null; + $this->metricsConfig = $input['metricsConfig'] ?? null; } /** @@ -153,6 +168,7 @@ public function __construct(array $input) * maxBatchSize?: null|int, * runtime?: null|AppSyncRuntime|array, * code?: null|string, + * metricsConfig?: null|ResolverLevelMetricsConfig::*, * }|Resolver $input */ public static function create($input): self @@ -193,6 +209,14 @@ public function getMaxBatchSize(): ?int return $this->maxBatchSize; } + /** + * @return ResolverLevelMetricsConfig::*|null + */ + public function getMetricsConfig(): ?string + { + return $this->metricsConfig; + } + public function getPipelineConfig(): ?PipelineConfig { return $this->pipelineConfig;