Table of Contents

Class MethodProps

Namespace
Amazon.CDK.AWS.APIGateway
Assembly
Amazon.CDK.AWS.APIGateway.dll
public class MethodProps : IMethodProps
Inheritance
MethodProps
Implements
Inherited Members

Examples

// The code below shows an example of how to instantiate this type.
            // The values are placeholders you should change.
            using Amazon.CDK.AWS.APIGateway;

            Authorizer authorizer;
            Integration integration;
            Model model;
            RequestValidator requestValidator;
            Resource resource;

            var methodProps = new MethodProps {
                HttpMethod = "httpMethod",
                Resource = resource,

                // the properties below are optional
                Integration = integration,
                Options = new MethodOptions {
                    ApiKeyRequired = false,
                    AuthorizationScopes = new [] { "authorizationScopes" },
                    AuthorizationType = AuthorizationType.NONE,
                    Authorizer = authorizer,
                    MethodResponses = new [] { new MethodResponse {
                        StatusCode = "statusCode",

                        // the properties below are optional
                        ResponseModels = new Dictionary<string, IModel> {
                            { "responseModelsKey", model }
                        },
                        ResponseParameters = new Dictionary<string, boolean> {
                            { "responseParametersKey", false }
                        }
                    } },
                    OperationName = "operationName",
                    RequestModels = new Dictionary<string, IModel> {
                        { "requestModelsKey", model }
                    },
                    RequestParameters = new Dictionary<string, boolean> {
                        { "requestParametersKey", false }
                    },
                    RequestValidator = requestValidator,
                    RequestValidatorOptions = new RequestValidatorOptions {
                        RequestValidatorName = "requestValidatorName",
                        ValidateRequestBody = false,
                        ValidateRequestParameters = false
                    }
                }
            };

Remarks

ExampleMetadata: fixture=_generated

Constructors

MethodProps()

public MethodProps()

Properties

HttpMethod

The HTTP method ("GET", "POST", "PUT", ...) that clients use to call this method.

public string HttpMethod { get; set; }

Property Value

string

Integration

The backend system that the method calls when it receives a request.

public Integration? Integration { get; set; }

Property Value

Integration

Remarks

Default: - a new MockIntegration.

Options

Method options.

public IMethodOptions? Options { get; set; }

Property Value

IMethodOptions

Remarks

Default: - No options.

Resource

The resource this method is associated with.

public IResource Resource { get; set; }

Property Value

IResource

Remarks

For root resource methods, specify the RestApi object.