LambdaSharp.ApiGateway 0.8.4

.NET 6.0
Install-Package LambdaSharp.ApiGateway -Version 0.8.4
dotnet add package LambdaSharp.ApiGateway --version 0.8.4
<PackageReference Include="LambdaSharp.ApiGateway" Version="0.8.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LambdaSharp.ApiGateway --version 0.8.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: LambdaSharp.ApiGateway, 0.8.4"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install LambdaSharp.ApiGateway as a Cake Addin
#addin nuget:?package=LambdaSharp.ApiGateway&version=0.8.4

// Install LambdaSharp.ApiGateway as a Cake Tool
#tool nuget:?package=LambdaSharp.ApiGateway&version=0.8.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

LambdaSharp.ApiGateway

This package contains interfaces and classes used for building Lambda functions on AWS which integrate with API Gateway and API Gateway V2. This package extends the functionality provided the LambdaSharp package.

Visit LambdaSharp.NET to learn more about building serverless .NET solutions on AWS.

ALambdaApiGatewayFunction

The ALambdaApiGatewayFunction base class provides capabilities for mapping REST API and WebSocket endpoints defined in the LambdaSharp module file directly to methods of the class.

public sealed class Function : ALambdaApiGatewayFunction {

    //--- Constructors ---
    public Function() : base(new LambdaSharp.Serialization.LambdaSystemTextJsonSerializer()) { }

    //--- Methods ---
    public override async Task InitializeAsync(LambdaConfig config) {

        // TO-DO: add function initialization and reading configuration settings
    }

    public async Task<AddItemResponse> AddItem(AddItemRequest request) {

        // TO-DO: add business logic for API Gateway resource endpoint
        return new AddItemResponse { };
    }
}

In the corresponding Module.yml file might look something like this:

- Function: MyFunction
  Memory: 128
  Timeout: 30
  Sources:
    - Api: POST:/items
      Invoke: AddItem

ALambdaApiGatewayFunction (Proxy)

The ALambdaApiGatewayFunction base class can also be used to process generic API Gateway invocations.

public sealed class Function : ALambdaApiGatewayFunction {

    //--- Constructors ---
    public Function() : base(new LambdaSharp.Serialization.LambdaSystemTextJsonSerializer()) { }

    //--- Methods ---
    public override async Task InitializeAsync(LambdaConfig config) {

        // TO-DO: add function initialization and reading configuration settings
    }

    public override async Task<APIGatewayProxyResponse> ProcessProxyRequestAsync(APIGatewayProxyRequest request) {

        // TO-DO: add business logic for API Gateway proxy request handling

        return new APIGatewayProxyResponse {
            Body = "Ok",
            Headers = new Dictionary<string, string> {
                ["Content-Type"] = "text/plain"
            },
            StatusCode = 200
        };
    }
}

License

Copyright (c) 2018-2022 LambdaSharp (λ#)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License 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.

Product Versions
.NET net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.8.4 85 3/10/2022
0.8.3.5 87 3/4/2022
0.8.3.4 186 7/15/2021
0.8.3.3 176 7/15/2021
0.8.3.2 179 6/17/2021
0.8.3 145 5/19/2021
0.8.2.4 197 4/30/2021
0.8.2.3 146 4/2/2021
0.8.2.2 149 3/18/2021
0.8.2 5,166 2/16/2021