Skip to content

Api Gateway  >  Structures  >  MethodSetting

MethodSetting

Structure Class

MethodSetting dataclass

Specifies the method setting properties.

Attributes

cache_data_encrypted class-attribute instance-attribute
cache_data_encrypted: bool = False

Specifies whether the cached responses are encrypted.

cache_ttl_in_seconds class-attribute instance-attribute
cache_ttl_in_seconds: int = 0

Specifies the time to live (TTL), in seconds, for cached responses. The higher the TTL, the longer the response will be cached.

caching_enabled class-attribute instance-attribute
caching_enabled: bool = False

Specifies whether responses should be cached and returned for requests. A cache cluster must be enabled on the stage for responses to be cached.

data_trace_enabled class-attribute instance-attribute
data_trace_enabled: bool = False

Specifies whether data trace logging is enabled for this method, which affects the log entries pushed to Amazon CloudWatch Logs. This can be useful to troubleshoot APIs, but can result in logging sensitive data. We recommend that you don't enable this option for production APIs.

logging_level class-attribute instance-attribute
logging_level: str | None = None

Specifies the logging level for this method, which affects the log entries pushed to Amazon CloudWatch Logs. Valid values are OFF, ERROR, and INFO. Choose ERROR to write only error-level entries to CloudWatch Logs, or choose INFO to include all ERROR events as well as extra informational events.

metrics_enabled class-attribute instance-attribute
metrics_enabled: bool = False

Specifies whether Amazon CloudWatch metrics are enabled for this method.

require_authorization_for_cache_control class-attribute instance-attribute
require_authorization_for_cache_control: bool = False

Specifies whether authorization is required for a cache invalidation request.

throttling_burst_limit class-attribute instance-attribute
throttling_burst_limit: int = 0

Specifies the throttling burst limit.

throttling_rate_limit class-attribute instance-attribute
throttling_rate_limit: float = 0

Specifies the throttling rate limit.

unauthorized_cache_control_header_strategy class-attribute instance-attribute
unauthorized_cache_control_header_strategy: UnauthorizedCacheControlHeaderStrategy | None = None

Specifies how to handle unauthorized requests for cache invalidation.