Skip to content

Commit

Permalink
Update generated code (#1601)
Browse files Browse the repository at this point in the history
* update generated code

* Disable tests using fakesqs

* Update SQS test to be compatible with JSON API

---------

Co-authored-by: Jérémy Derussé <[email protected]>
  • Loading branch information
async-aws-bot and jderusse authored Nov 23, 2023
1 parent 42c9a17 commit 9cab464
Show file tree
Hide file tree
Showing 12 changed files with 307 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
### Added

- AWS api-change: Adds support for Lambda functions to access Dual-Stack subnets over IPv6, via an opt-in flag in CreateFunction and UpdateFunctionConfiguration APIs
- AWS api-change: Adds support for logging configuration in Lambda Functions. Customers will have more control how their function logs are captured and to which cloud watch log group they are delivered also.
- AWS api-change: Add Java 21 (java21) support to AWS Lambda
- AWS api-change: Add Python 3.12 (python3.12) support to AWS Lambda
- AWS api-change: Add Custom runtime on Amazon Linux 2023 (provided.al2023) support to AWS Lambda.
- AWS api-change: Add Node 20 (nodejs20.x) support to AWS Lambda.

## 2.1.0

Expand Down
25 changes: 25 additions & 0 deletions src/Enum/ApplicationLogLevel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace AsyncAws\Lambda\Enum;

final class ApplicationLogLevel
{
public const DEBUG = 'DEBUG';
public const ERROR = 'ERROR';
public const FATAL = 'FATAL';
public const INFO = 'INFO';
public const TRACE = 'TRACE';
public const WARN = 'WARN';

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

namespace AsyncAws\Lambda\Enum;

final class LogFormat
{
public const JSON = 'JSON';
public const TEXT = 'Text';

public static function exists(string $value): bool
{
return isset([
self::JSON => true,
self::TEXT => true,
][$value]);
}
}
8 changes: 8 additions & 0 deletions src/Enum/Runtime.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ final class Runtime
public const GO_1_X = 'go1.x';
public const JAVA_11 = 'java11';
public const JAVA_17 = 'java17';
public const JAVA_21 = 'java21';
public const JAVA_8 = 'java8';
public const JAVA_8_AL_2 = 'java8.al2';
public const NODEJS = 'nodejs';
Expand All @@ -20,15 +21,18 @@ final class Runtime
public const NODEJS_14_X = 'nodejs14.x';
public const NODEJS_16_X = 'nodejs16.x';
public const NODEJS_18_X = 'nodejs18.x';
public const NODEJS_20_X = 'nodejs20.x';
public const NODEJS_4_3 = 'nodejs4.3';
public const NODEJS_4_3_EDGE = 'nodejs4.3-edge';
public const NODEJS_6_10 = 'nodejs6.10';
public const NODEJS_8_10 = 'nodejs8.10';
public const PROVIDED = 'provided';
public const PROVIDED_AL_2 = 'provided.al2';
public const PROVIDED_AL_2023 = 'provided.al2023';
public const PYTHON_2_7 = 'python2.7';
public const PYTHON_3_10 = 'python3.10';
public const PYTHON_3_11 = 'python3.11';
public const PYTHON_3_12 = 'python3.12';
public const PYTHON_3_6 = 'python3.6';
public const PYTHON_3_7 = 'python3.7';
public const PYTHON_3_8 = 'python3.8';
Expand All @@ -48,6 +52,7 @@ public static function exists(string $value): bool
self::GO_1_X => true,
self::JAVA_11 => true,
self::JAVA_17 => true,
self::JAVA_21 => true,
self::JAVA_8 => true,
self::JAVA_8_AL_2 => true,
self::NODEJS => true,
Expand All @@ -56,15 +61,18 @@ public static function exists(string $value): bool
self::NODEJS_14_X => true,
self::NODEJS_16_X => true,
self::NODEJS_18_X => true,
self::NODEJS_20_X => true,
self::NODEJS_4_3 => true,
self::NODEJS_4_3_EDGE => true,
self::NODEJS_6_10 => true,
self::NODEJS_8_10 => true,
self::PROVIDED => true,
self::PROVIDED_AL_2 => true,
self::PROVIDED_AL_2023 => true,
self::PYTHON_2_7 => true,
self::PYTHON_3_10 => true,
self::PYTHON_3_11 => true,
self::PYTHON_3_12 => true,
self::PYTHON_3_6 => true,
self::PYTHON_3_7 => true,
self::PYTHON_3_8 => true,
Expand Down
19 changes: 19 additions & 0 deletions src/Enum/SystemLogLevel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace AsyncAws\Lambda\Enum;

final class SystemLogLevel
{
public const DEBUG = 'DEBUG';
public const INFO = 'INFO';
public const WARN = 'WARN';

public static function exists(string $value): bool
{
return isset([
self::DEBUG => true,
self::INFO => true,
self::WARN => true,
][$value]);
}
}
26 changes: 26 additions & 0 deletions src/Input/UpdateFunctionConfigurationRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use AsyncAws\Lambda\ValueObject\EphemeralStorage;
use AsyncAws\Lambda\ValueObject\FileSystemConfig;
use AsyncAws\Lambda\ValueObject\ImageConfig;
use AsyncAws\Lambda\ValueObject\LoggingConfig;
use AsyncAws\Lambda\ValueObject\SnapStart;
use AsyncAws\Lambda\ValueObject\TracingConfig;
use AsyncAws\Lambda\ValueObject\VpcConfig;
Expand Down Expand Up @@ -196,6 +197,13 @@ final class UpdateFunctionConfigurationRequest extends Input
*/
private $snapStart;

/**
* The function's Amazon CloudWatch Logs configuration settings.
*
* @var LoggingConfig|null
*/
private $loggingConfig;

/**
* @param array{
* FunctionName?: string,
Expand All @@ -216,6 +224,7 @@ final class UpdateFunctionConfigurationRequest extends Input
* ImageConfig?: null|ImageConfig|array,
* EphemeralStorage?: null|EphemeralStorage|array,
* SnapStart?: null|SnapStart|array,
* LoggingConfig?: null|LoggingConfig|array,
* '@region'?: string|null,
* } $input
*/
Expand All @@ -239,6 +248,7 @@ public function __construct(array $input = [])
$this->imageConfig = isset($input['ImageConfig']) ? ImageConfig::create($input['ImageConfig']) : null;
$this->ephemeralStorage = isset($input['EphemeralStorage']) ? EphemeralStorage::create($input['EphemeralStorage']) : null;
$this->snapStart = isset($input['SnapStart']) ? SnapStart::create($input['SnapStart']) : null;
$this->loggingConfig = isset($input['LoggingConfig']) ? LoggingConfig::create($input['LoggingConfig']) : null;
parent::__construct($input);
}

Expand All @@ -262,6 +272,7 @@ public function __construct(array $input = [])
* ImageConfig?: null|ImageConfig|array,
* EphemeralStorage?: null|EphemeralStorage|array,
* SnapStart?: null|SnapStart|array,
* LoggingConfig?: null|LoggingConfig|array,
* '@region'?: string|null,
* }|UpdateFunctionConfigurationRequest $input
*/
Expand Down Expand Up @@ -326,6 +337,11 @@ public function getLayers(): array
return $this->layers ?? [];
}

public function getLoggingConfig(): ?LoggingConfig
{
return $this->loggingConfig;
}

public function getMemorySize(): ?int
{
return $this->memorySize;
Expand Down Expand Up @@ -472,6 +488,13 @@ public function setLayers(array $value): self
return $this;
}

public function setLoggingConfig(?LoggingConfig $value): self
{
$this->loggingConfig = $value;

return $this;
}

public function setMemorySize(?int $value): self
{
$this->memorySize = $value;
Expand Down Expand Up @@ -599,6 +622,9 @@ private function requestBody(): array
if (null !== $v = $this->snapStart) {
$payload['SnapStart'] = $v->requestBody();
}
if (null !== $v = $this->loggingConfig) {
$payload['LoggingConfig'] = $v->requestBody();
}

return $payload;
}
Expand Down
8 changes: 6 additions & 2 deletions src/LambdaClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
use AsyncAws\Lambda\ValueObject\FileSystemConfig;
use AsyncAws\Lambda\ValueObject\ImageConfig;
use AsyncAws\Lambda\ValueObject\LayerVersionContentInput;
use AsyncAws\Lambda\ValueObject\LoggingConfig;
use AsyncAws\Lambda\ValueObject\SnapStart;
use AsyncAws\Lambda\ValueObject\TracingConfig;
use AsyncAws\Lambda\ValueObject\VpcConfig;
Expand Down Expand Up @@ -196,8 +197,10 @@ public function getFunctionConfiguration($input): FunctionConfiguration
}

/**
* Invokes a Lambda function. You can invoke a function synchronously (and wait for the response), or asynchronously. To
* invoke a function asynchronously, set `InvocationType` to `Event`.
* Invokes a Lambda function. You can invoke a function synchronously (and wait for the response), or asynchronously. By
* default, Lambda invokes your function synchronously (i.e. the`InvocationType` is `RequestResponse`). To invoke a
* function asynchronously, set `InvocationType` to `Event`. Lambda passes the `ClientContext` object to your function
* for synchronous invocations only.
*
* For synchronous invocation [^1], details about the function response, including errors, are included in the response
* body and headers. For either invocation type, you can find more information in the execution log [^2] and trace [^3].
Expand Down Expand Up @@ -508,6 +511,7 @@ public function publishLayerVersion($input): PublishLayerVersionResponse
* ImageConfig?: null|ImageConfig|array,
* EphemeralStorage?: null|EphemeralStorage|array,
* SnapStart?: null|SnapStart|array,
* LoggingConfig?: null|LoggingConfig|array,
* '@region'?: string|null,
* }|UpdateFunctionConfigurationRequest $input
*
Expand Down
26 changes: 26 additions & 0 deletions src/Result/FunctionConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use AsyncAws\Lambda\ValueObject\ImageConfigError;
use AsyncAws\Lambda\ValueObject\ImageConfigResponse;
use AsyncAws\Lambda\ValueObject\Layer;
use AsyncAws\Lambda\ValueObject\LoggingConfig;
use AsyncAws\Lambda\ValueObject\RuntimeVersionConfig;
use AsyncAws\Lambda\ValueObject\RuntimeVersionError;
use AsyncAws\Lambda\ValueObject\SnapStartResponse;
Expand Down Expand Up @@ -301,6 +302,13 @@ class FunctionConfiguration extends Result
*/
private $runtimeVersionConfig;

/**
* The function's Amazon CloudWatch Logs configuration settings.
*
* @var LoggingConfig|null
*/
private $loggingConfig;

/**
* @return list<Architecture::*>
*/
Expand Down Expand Up @@ -442,6 +450,13 @@ public function getLayers(): array
return $this->layers;
}

public function getLoggingConfig(): ?LoggingConfig
{
$this->initialize();

return $this->loggingConfig;
}

public function getMasterArn(): ?string
{
$this->initialize();
Expand Down Expand Up @@ -612,6 +627,7 @@ protected function populateResult(Response $response): void
$this->ephemeralStorage = empty($data['EphemeralStorage']) ? null : $this->populateResultEphemeralStorage($data['EphemeralStorage']);
$this->snapStart = empty($data['SnapStart']) ? null : $this->populateResultSnapStartResponse($data['SnapStart']);
$this->runtimeVersionConfig = empty($data['RuntimeVersionConfig']) ? null : $this->populateResultRuntimeVersionConfig($data['RuntimeVersionConfig']);
$this->loggingConfig = empty($data['LoggingConfig']) ? null : $this->populateResultLoggingConfig($data['LoggingConfig']);
}

/**
Expand Down Expand Up @@ -742,6 +758,16 @@ private function populateResultLayersReferenceList(array $json): array
return $items;
}

private function populateResultLoggingConfig(array $json): LoggingConfig
{
return new LoggingConfig([
'LogFormat' => isset($json['LogFormat']) ? (string) $json['LogFormat'] : null,
'ApplicationLogLevel' => isset($json['ApplicationLogLevel']) ? (string) $json['ApplicationLogLevel'] : null,
'SystemLogLevel' => isset($json['SystemLogLevel']) ? (string) $json['SystemLogLevel'] : null,
'LogGroup' => isset($json['LogGroup']) ? (string) $json['LogGroup'] : null,
]);
}

private function populateResultRuntimeVersionConfig(array $json): RuntimeVersionConfig
{
return new RuntimeVersionConfig([
Expand Down
12 changes: 12 additions & 0 deletions src/Result/ListFunctionsResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use AsyncAws\Lambda\ValueObject\ImageConfigError;
use AsyncAws\Lambda\ValueObject\ImageConfigResponse;
use AsyncAws\Lambda\ValueObject\Layer;
use AsyncAws\Lambda\ValueObject\LoggingConfig;
use AsyncAws\Lambda\ValueObject\RuntimeVersionConfig;
use AsyncAws\Lambda\ValueObject\RuntimeVersionError;
use AsyncAws\Lambda\ValueObject\SnapStartResponse;
Expand Down Expand Up @@ -232,6 +233,7 @@ private function populateResultFunctionConfiguration(array $json): FunctionConfi
'EphemeralStorage' => empty($json['EphemeralStorage']) ? null : $this->populateResultEphemeralStorage($json['EphemeralStorage']),
'SnapStart' => empty($json['SnapStart']) ? null : $this->populateResultSnapStartResponse($json['SnapStart']),
'RuntimeVersionConfig' => empty($json['RuntimeVersionConfig']) ? null : $this->populateResultRuntimeVersionConfig($json['RuntimeVersionConfig']),
'LoggingConfig' => empty($json['LoggingConfig']) ? null : $this->populateResultLoggingConfig($json['LoggingConfig']),
]);
}

Expand Down Expand Up @@ -296,6 +298,16 @@ private function populateResultLayersReferenceList(array $json): array
return $items;
}

private function populateResultLoggingConfig(array $json): LoggingConfig
{
return new LoggingConfig([
'LogFormat' => isset($json['LogFormat']) ? (string) $json['LogFormat'] : null,
'ApplicationLogLevel' => isset($json['ApplicationLogLevel']) ? (string) $json['ApplicationLogLevel'] : null,
'SystemLogLevel' => isset($json['SystemLogLevel']) ? (string) $json['SystemLogLevel'] : null,
'LogGroup' => isset($json['LogGroup']) ? (string) $json['LogGroup'] : null,
]);
}

private function populateResultRuntimeVersionConfig(array $json): RuntimeVersionConfig
{
return new RuntimeVersionConfig([
Expand Down
12 changes: 12 additions & 0 deletions src/Result/ListVersionsByFunctionResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use AsyncAws\Lambda\ValueObject\ImageConfigError;
use AsyncAws\Lambda\ValueObject\ImageConfigResponse;
use AsyncAws\Lambda\ValueObject\Layer;
use AsyncAws\Lambda\ValueObject\LoggingConfig;
use AsyncAws\Lambda\ValueObject\RuntimeVersionConfig;
use AsyncAws\Lambda\ValueObject\RuntimeVersionError;
use AsyncAws\Lambda\ValueObject\SnapStartResponse;
Expand Down Expand Up @@ -230,6 +231,7 @@ private function populateResultFunctionConfiguration(array $json): FunctionConfi
'EphemeralStorage' => empty($json['EphemeralStorage']) ? null : $this->populateResultEphemeralStorage($json['EphemeralStorage']),
'SnapStart' => empty($json['SnapStart']) ? null : $this->populateResultSnapStartResponse($json['SnapStart']),
'RuntimeVersionConfig' => empty($json['RuntimeVersionConfig']) ? null : $this->populateResultRuntimeVersionConfig($json['RuntimeVersionConfig']),
'LoggingConfig' => empty($json['LoggingConfig']) ? null : $this->populateResultLoggingConfig($json['LoggingConfig']),
]);
}

Expand Down Expand Up @@ -294,6 +296,16 @@ private function populateResultLayersReferenceList(array $json): array
return $items;
}

private function populateResultLoggingConfig(array $json): LoggingConfig
{
return new LoggingConfig([
'LogFormat' => isset($json['LogFormat']) ? (string) $json['LogFormat'] : null,
'ApplicationLogLevel' => isset($json['ApplicationLogLevel']) ? (string) $json['ApplicationLogLevel'] : null,
'SystemLogLevel' => isset($json['SystemLogLevel']) ? (string) $json['SystemLogLevel'] : null,
'LogGroup' => isset($json['LogGroup']) ? (string) $json['LogGroup'] : null,
]);
}

private function populateResultRuntimeVersionConfig(array $json): RuntimeVersionConfig
{
return new RuntimeVersionConfig([
Expand Down
Loading

0 comments on commit 9cab464

Please sign in to comment.