Skip to content

Commit

Permalink
Update generated code (#1664)
Browse files Browse the repository at this point in the history
update generated code
  • Loading branch information
async-aws-bot committed Feb 13, 2024
1 parent 8a1f9f6 commit bc7e9a8
Show file tree
Hide file tree
Showing 14 changed files with 216 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
"dev-master": "2.1-dev"
}
}
}
5 changes: 5 additions & 0 deletions src/AppSyncClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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
*
Expand Down
17 changes: 17 additions & 0 deletions src/Enum/DataSourceLevelMetricsConfig.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace AsyncAws\AppSync\Enum;

final class DataSourceLevelMetricsConfig
{
public const DISABLED = 'DISABLED';
public const ENABLED = 'ENABLED';

public static function exists(string $value): bool
{
return isset([
self::DISABLED => true,
self::ENABLED => true,
][$value]);
}
}
17 changes: 17 additions & 0 deletions src/Enum/ResolverLevelMetricsConfig.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace AsyncAws\AppSync\Enum;

final class ResolverLevelMetricsConfig
{
public const DISABLED = 'DISABLED';
public const ENABLED = 'ENABLED';

public static function exists(string $value): bool
{
return isset([
self::DISABLED => true,
self::ENABLED => true,
][$value]);
}
}
40 changes: 40 additions & 0 deletions src/Input/CreateResolverRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -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
*/
Expand All @@ -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);
}

Expand All @@ -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
*/
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
40 changes: 40 additions & 0 deletions src/Input/UpdateDataSourceRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -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
*/
Expand All @@ -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);
}

Expand All @@ -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
*/
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
40 changes: 40 additions & 0 deletions src/Input/UpdateResolverRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -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
*/
Expand All @@ -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);
}

Expand All @@ -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
*/
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions src/Result/CreateResolverResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]);
}

Expand Down
1 change: 1 addition & 0 deletions src/Result/ListResolversResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]);
}

Expand Down
Loading

0 comments on commit bc7e9a8

Please sign in to comment.