-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #163 from hossambarakat/feature/idempotency
Great work!!
- Loading branch information
Showing
44 changed files
with
4,971 additions
and
3 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
libraries/src/AWS.Lambda.Powertools.Common/Core/PowertoolsLambdaContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Reflection; | ||
|
||
namespace AWS.Lambda.Powertools.Common; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
libraries/src/AWS.Lambda.Powertools.Idempotency/AWS.Lambda.Powertools.Idempotency.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<LangVersion>default</LangVersion> | ||
<PackageId>AWS.Lambda.Powertools.Idempotency</PackageId> | ||
<Version>0.0.1</Version> | ||
<Authors>Amazon Web Services</Authors> | ||
<Company>Amazon.com, Inc</Company> | ||
<Title>AWS Lambda Powertools for .NET</Title> | ||
<Description>AWS Lambda Powertools for .NET - Idempotency package.</Description> | ||
<Copyright>Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.</Copyright> | ||
<RepositoryUrl>https://github.com/awslabs/aws-lambda-powertools-dotnet</RepositoryUrl> | ||
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression> | ||
<PackageTags>AWS;Amazon;Lambda;Powertools</PackageTags> | ||
<PackageReadmeFile>README.md</PackageReadmeFile> | ||
<PackageIconUrl>https://sdk-for-net.amazonwebservices.com/images/AWSLogo128x128.png</PackageIconUrl> | ||
<PackageIcon>AWSLogo128x128.png</PackageIcon> | ||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> | ||
<AssemblyName>AWS.Lambda.Powertools.Idempotency</AssemblyName> | ||
<RootNamespace>AWS.Lambda.Powertools.Idempotency</RootNamespace> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Include="README.md" Pack="true" PackagePath="\" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Amazon.Lambda.Core" Version="2.1.0" /> | ||
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.103.7" /> | ||
<PackageReference Include="JmesPath.Net" Version="1.0.308" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\AWS.Lambda.Powertools.Common\AWS.Lambda.Powertools.Common.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="../../AWSLogo128x128.png" Pack="true" Visible="false" PackagePath="" /> | ||
</ItemGroup> | ||
|
||
</Project> |
44 changes: 44 additions & 0 deletions
44
...src/AWS.Lambda.Powertools.Idempotency/Exceptions/IdempotencyAlreadyInProgressException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
using System; | ||
|
||
namespace AWS.Lambda.Powertools.Idempotency.Exceptions; | ||
|
||
/// <summary> | ||
/// This exception is thrown when the same payload is sent | ||
/// while the previous one was not yet fully stored in the persistence layer (marked as COMPLETED). | ||
/// Implements the <see cref="System.Exception" /> | ||
/// </summary> | ||
/// <seealso cref="System.Exception" /> | ||
public class IdempotencyAlreadyInProgressException: Exception | ||
{ | ||
/// <summary> | ||
/// Creates a new IdempotencyAlreadyInProgressException | ||
/// </summary> | ||
public IdempotencyAlreadyInProgressException() | ||
{ | ||
} | ||
|
||
/// <inheritdoc /> | ||
public IdempotencyAlreadyInProgressException(string message) : base(message) | ||
{ | ||
} | ||
|
||
/// <inheritdoc /> | ||
public IdempotencyAlreadyInProgressException(string message, Exception innerException) : base(message, innerException) | ||
{ | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...ies/src/AWS.Lambda.Powertools.Idempotency/Exceptions/IdempotencyConfigurationException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
using System; | ||
|
||
namespace AWS.Lambda.Powertools.Idempotency.Exceptions; | ||
|
||
/// <summary> | ||
/// Exception thrown when Idempotency is not well configured: | ||
/// - An annotated method does not return anything | ||
/// - An annotated method does not use Task as return value | ||
/// - An annotated method does not have parameters | ||
/// </summary> | ||
public class IdempotencyConfigurationException : Exception | ||
{ | ||
/// <summary> | ||
/// Creates a new IdempotencyConfigurationException | ||
/// </summary> | ||
public IdempotencyConfigurationException() | ||
{ | ||
} | ||
|
||
/// <inheritdoc /> | ||
public IdempotencyConfigurationException(string message) : base(message) | ||
{ | ||
} | ||
|
||
/// <inheritdoc /> | ||
public IdempotencyConfigurationException(string message, Exception innerException) : base(message, innerException) | ||
{ | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...src/AWS.Lambda.Powertools.Idempotency/Exceptions/IdempotencyInconsistentStateException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
using System; | ||
|
||
namespace AWS.Lambda.Powertools.Idempotency.Exceptions; | ||
|
||
/// <summary> | ||
/// Exception can happen under rare but expected cases | ||
/// when persistent state changes in the small-time between put and get requests. | ||
/// </summary> | ||
public class IdempotencyInconsistentStateException : Exception | ||
{ | ||
/// <summary> | ||
/// Creates a new IdempotencyInconsistentStateException | ||
/// </summary> | ||
public IdempotencyInconsistentStateException() | ||
{ | ||
} | ||
|
||
/// <inheritdoc /> | ||
public IdempotencyInconsistentStateException(string message) : base(message) | ||
{ | ||
} | ||
|
||
/// <inheritdoc /> | ||
public IdempotencyInconsistentStateException(string message, Exception innerException) : base(message, innerException) | ||
{ | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
...src/AWS.Lambda.Powertools.Idempotency/Exceptions/IdempotencyItemAlreadyExistsException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
using System; | ||
|
||
namespace AWS.Lambda.Powertools.Idempotency.Exceptions; | ||
|
||
/// <summary> | ||
/// Exception thrown when trying to store an item which already exists. | ||
/// </summary> | ||
public class IdempotencyItemAlreadyExistsException : Exception | ||
{ | ||
/// <summary> | ||
/// Creates a new IdempotencyItemAlreadyExistsException | ||
/// </summary> | ||
public IdempotencyItemAlreadyExistsException() | ||
{ | ||
} | ||
|
||
/// <inheritdoc /> | ||
public IdempotencyItemAlreadyExistsException(string message) : base(message) | ||
{ | ||
} | ||
|
||
/// <inheritdoc /> | ||
public IdempotencyItemAlreadyExistsException(string message, Exception innerException) : base(message, innerException) | ||
{ | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
...ries/src/AWS.Lambda.Powertools.Idempotency/Exceptions/IdempotencyItemNotFoundException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
using System; | ||
|
||
namespace AWS.Lambda.Powertools.Idempotency.Exceptions; | ||
|
||
/// <summary> | ||
/// Exception thrown when the item was not found in the persistence store. | ||
/// </summary> | ||
public class IdempotencyItemNotFoundException : Exception | ||
{ | ||
/// <summary> | ||
/// Creates a new IdempotencyItemNotFoundException | ||
/// </summary> | ||
public IdempotencyItemNotFoundException() | ||
{ | ||
} | ||
|
||
/// <inheritdoc /> | ||
public IdempotencyItemNotFoundException(string message) : base(message) | ||
{ | ||
} | ||
|
||
/// <inheritdoc /> | ||
public IdempotencyItemNotFoundException(string message, Exception innerException) : base(message, innerException) | ||
{ | ||
} | ||
} |
Oops, something went wrong.