# APIGatewayExtensions Methods

- Package: [Aspire.Hosting.AWS](/reference/api/csharp/aspire.hosting.aws.md)
- Type: [APIGatewayExtensions](/reference/api/csharp/aspire.hosting.aws/apigatewayextensions.md)
- Kind: `Methods`
- Members: `2`

Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.

## AddAWSAPIGatewayEmulator(IDistributedApplicationBuilder, string, APIGatewayType, APIGatewayEmulatorOptions?)

- Name: `AddAWSAPIGatewayEmulator(IDistributedApplicationBuilder, string, APIGatewayType, APIGatewayEmulatorOptions?)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<APIGatewayEmulatorResource>`

```csharp
public static class APIGatewayExtensions
{
    public static IResourceBuilder<APIGatewayEmulatorResource> AddAWSAPIGatewayEmulator(
        this IDistributedApplicationBuilder builder,
        string name,
        APIGatewayType apiGatewayType,
        APIGatewayEmulatorOptions? options = null)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IDistributedApplicationBuilder`)
- `name` (`string`)
- `apiGatewayType` ([APIGatewayType](/reference/api/csharp/aspire.hosting.aws/apigatewaytype.md))
- `options` ([APIGatewayEmulatorOptions?](/reference/api/csharp/aspire.hosting.aws/apigatewayemulatoroptions.md)) `optional`

## WithReference(IResourceBuilder<APIGatewayEmulatorResource>, IResourceBuilder<LambdaProjectResource>, Method, string)

- Name: `WithReference(IResourceBuilder<APIGatewayEmulatorResource>, IResourceBuilder<LambdaProjectResource>, Method, string)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<APIGatewayEmulatorResource>`

```csharp
public static class APIGatewayExtensions
{
    public static IResourceBuilder<APIGatewayEmulatorResource> WithReference(
        this IResourceBuilder<APIGatewayEmulatorResource> builder,
        IResourceBuilder<LambdaProjectResource> lambda,
        Method httpMethod,
        string path)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<APIGatewayEmulatorResource>`)
- `lambda` (`IResourceBuilder<LambdaProjectResource>`)
- `httpMethod` ([Method](/reference/api/csharp/aspire.hosting.aws/method.md))
- `path` (`string`)
