Class MethodResponse
Provides an HTTP Method Response for an API Gateway Resource.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var myDemoAPI = new Aws.ApiGateway.RestApi("myDemoAPI", new Aws.ApiGateway.RestApiArgs
{
Description = "This is my API for demonstration purposes",
});
var myDemoResource = new Aws.ApiGateway.Resource("myDemoResource", new Aws.ApiGateway.ResourceArgs
{
ParentId = myDemoAPI.RootResourceId,
PathPart = "mydemoresource",
RestApi = myDemoAPI.Id,
});
var myDemoMethod = new Aws.ApiGateway.Method("myDemoMethod", new Aws.ApiGateway.MethodArgs
{
Authorization = "NONE",
HttpMethod = "GET",
ResourceId = myDemoResource.Id,
RestApi = myDemoAPI.Id,
});
var myDemoIntegration = new Aws.ApiGateway.Integration("myDemoIntegration", new Aws.ApiGateway.IntegrationArgs
{
HttpMethod = myDemoMethod.HttpMethod,
ResourceId = myDemoResource.Id,
RestApi = myDemoAPI.Id,
Type = "MOCK",
});
var response200 = new Aws.ApiGateway.MethodResponse("response200", new Aws.ApiGateway.MethodResponseArgs
{
HttpMethod = myDemoMethod.HttpMethod,
ResourceId = myDemoResource.Id,
RestApi = myDemoAPI.Id,
StatusCode = "200",
});
}
}
Inherited Members
Namespace: Pulumi.Aws.ApiGateway
Assembly: Pulumi.Aws.dll
Syntax
public class MethodResponse : CustomResource
Constructors
View SourceMethodResponse(String, MethodResponseArgs, CustomResourceOptions)
Create a MethodResponse resource with the given unique name, arguments, and options.
Declaration
public MethodResponse(string name, MethodResponseArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| MethodResponseArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceHttpMethod
The HTTP Method (GET, POST, PUT, DELETE, HEAD, OPTIONS, ANY)
Declaration
public Output<string> HttpMethod { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ResourceId
The API resource ID
Declaration
public Output<string> ResourceId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ResponseModels
A map of the API models used for the response's content type
Declaration
public Output<ImmutableDictionary<string, string>> ResponseModels { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>> |
ResponseParameters
A map of response parameters that can be sent to the caller.
For example: response_parameters = { "method.response.header.X-Some-Header" = true }
would define that the header X-Some-Header can be provided on the response.
Declaration
public Output<ImmutableDictionary<string, bool>> ResponseParameters { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Boolean>> |
RestApi
The ID of the associated REST API
Declaration
public Output<string> RestApi { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
StatusCode
The HTTP status code
Declaration
public Output<string> StatusCode { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, MethodResponseState, CustomResourceOptions)
Get an existing MethodResponse resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static MethodResponse Get(string name, Input<string> id, MethodResponseState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| MethodResponseState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| MethodResponse |