< Summary

Information
Class: NanoRoute.AwsLambda.ApiGatewayV2RouterConfig
Assembly: NanoRoute.AwsLambda.dll
File(s): /home/runner/work/nanoroute/nanoroute/Src/NanoRoute.AwsLambda/Public/ApiGatewayV2RouterConfig.cs
Line coverage
100%
Covered lines: 10
Uncovered lines: 0
Coverable lines: 10
Total lines: 89
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBlocks covered Blocks not covered
ApiGatewayV2RouterConfig()30

File(s)

/home/runner/work/nanoroute/nanoroute/Src/NanoRoute.AwsLambda/Public/ApiGatewayV2RouterConfig.cs

#LineLine coverage
 1/********************************************************************************
 2* ApiGatewayV2RouterConfig.cs                                                   *
 3*                                                                               *
 4* Author: Denes Solti                                                           *
 5********************************************************************************/
 6namespace NanoRoute.AwsLambda
 7{
 8    using System;
 9
 10    /// <summary>
 11    /// Configuration settings shared by the AWS Lambda router adapters.
 12    /// </summary>
 13    /// <example>
 14    /// <code>
 15    /// ApiGatewayV2Router router = builder.CreateRouter(config =&gt;
 16    /// {
 17    ///     config.LambdaTimeoutBuffer = TimeSpan.FromSeconds(2);
 18    /// });
 19    /// </code>
 20    /// </example>
 21    public sealed class ApiGatewayV2RouterConfig : RouterConfig
 22    {
 23        /// <summary>
 24        /// Gets or sets the amount of time reserved before the Lambda invocation timeout is reached.
 25        /// </summary>
 26        /// <exception cref="ArgumentOutOfRangeException">Thrown when the assigned value is negative.</exception>
 27        /// <example>
 28        /// <code>
 29        /// ApiGatewayV2Router router = builder.CreateRouter(config =&gt;
 30        /// {
 31        ///     config.LambdaTimeoutBuffer = TimeSpan.FromSeconds(2);
 32        /// });
 33        /// </code>
 34        /// </example>
 35        public TimeSpan LambdaTimeoutBuffer
 36        {
 37            get;
 38            set
 139            {
 140                ArgumentOutOfRangeException.ThrowIfLessThan(value, TimeSpan.Zero);
 141                field = value;
 142            }
 143        } = TimeSpan.FromSeconds(1);
 44
 45        /// <summary>
 46        /// Gets or sets the URI scheme used when mapping AWS HTTP API and Lambda Function URL events to
 47        /// <see cref="System.Net.Http.HttpRequestMessage.RequestUri"/>.
 48        /// </summary>
 49        /// <remarks>
 50        /// The default is <c>https</c>.
 51        /// </remarks>
 52        /// <exception cref="ArgumentNullException">Thrown when the assigned value is <see langword="null"/>.</exception
 53        /// <example>
 54        /// <code>
 55        /// ApiGatewayV2Router router = builder.CreateRouter(config =&gt;
 56        /// {
 57        ///     config.RequestScheme = "https";
 58        /// });
 59        /// </code>
 60        /// </example>
 61        public string RequestScheme
 62        {
 63            get;
 64            set
 165            {
 166                ArgumentNullException.ThrowIfNull(value);
 167                field = value;
 168            }
 169        } = "https";
 70
 71        /// <summary>
 72        /// Gets or sets the host, optionally including a port, used when mapping AWS HTTP API and Lambda Function URL
 73        /// events to <see cref="System.Net.Http.HttpRequestMessage.RequestUri"/>.
 74        /// </summary>
 75        /// <remarks>
 76        /// When this value is <see langword="null"/>, the adapter uses <c>requestContext.domainName</c> from the AWS ev
 77        /// Set this value when your application needs a canonical public host that differs from the event domain name.
 78        /// </remarks>
 79        /// <example>
 80        /// <code>
 81        /// ApiGatewayV2Router router = builder.CreateRouter(config =&gt;
 82        /// {
 83        ///     config.RequestDomain = "api.example.com";
 84        /// });
 85        /// </code>
 86        /// </example>
 87        public string? RequestDomain { get; set; }
 88    }
 89}