MethodOptions

class aws_cdk.aws_apigateway.MethodOptions(*, api_key_required=None, authorization_type=None, authorizer=None, method_responses=None, operation_name=None, request_models=None, request_parameters=None, request_validator=None)

Bases: object

__init__(*, api_key_required=None, authorization_type=None, authorizer=None, method_responses=None, operation_name=None, request_models=None, request_parameters=None, request_validator=None)
Parameters
  • api_key_required (Optional[bool]) – Indicates whether the method requires clients to submit a valid API key. Default: false

  • authorization_type (Optional[AuthorizationType]) – Method authorization. Default: None open access

  • authorizer (Optional[IAuthorizer]) – If authorizationType is Custom, this specifies the ID of the method authorizer resource.

  • method_responses (Optional[List[MethodResponse]]) – The responses that can be sent to the client who calls the method. Default: None This property is not required, but if these are not supplied for a Lambda proxy integration, the Lambda function must return a value of the correct format, for the integration response to be correctly mapped to a response to the client.

  • operation_name (Optional[str]) – A friendly operation name for the method. For example, you can assign the OperationName of ListPets for the GET /pets method.

  • request_models (Optional[Mapping[str, IModel]]) – The resources that are used for the response’s content type. Specify request models as key-value pairs (string-to-string mapping), with a content type as the key and a Model resource name as the value

  • request_parameters (Optional[Mapping[str, bool]]) – The request parameters that API Gateway accepts. Specify request parameters as key-value pairs (string-to-Boolean mapping), with a source as the key and a Boolean as the value. The Boolean specifies whether a parameter is required. A source must match the format method.request.location.name, where the location is querystring, path, or header, and name is a valid, unique parameter name. Default: None

  • request_validator (Optional[IRequestValidator]) – The ID of the associated request validator.

Attributes

api_key_required

Indicates whether the method requires clients to submit a valid API key.

default :default: false

Return type

Optional[bool]

authorization_type

Method authorization.

default :default: None open access

Return type

Optional[AuthorizationType]

authorizer

If authorizationType is Custom, this specifies the ID of the method authorizer resource.

Return type

Optional[IAuthorizer]

method_responses

The responses that can be sent to the client who calls the method.

default :default:

None

This property is not required, but if these are not supplied for a Lambda proxy integration, the Lambda function must return a value of the correct format, for the integration response to be correctly mapped to a response to the client.

see :see: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-method-settings-method-response.html

Return type

Optional[List[MethodResponse]]

operation_name

A friendly operation name for the method.

For example, you can assign the OperationName of ListPets for the GET /pets method.

Return type

Optional[str]

request_models

The resources that are used for the response’s content type.

Specify request models as key-value pairs (string-to-string mapping), with a content type as the key and a Model resource name as the value

Return type

Optional[Mapping[str, IModel]]

request_parameters

The request parameters that API Gateway accepts.

Specify request parameters as key-value pairs (string-to-Boolean mapping), with a source as the key and a Boolean as the value. The Boolean specifies whether a parameter is required. A source must match the format method.request.location.name, where the location is querystring, path, or header, and name is a valid, unique parameter name.

default :default: None

Return type

Optional[Mapping[str, bool]]

request_validator

The ID of the associated request validator.

Return type

Optional[IRequestValidator]