put_method
¶
put_method(
rest_api_id: String,
resource_id: String,
http_method: String,
authorization_type: String,
*,
config_overrides: Optional[APIGatewayClientConfig] = None,
authorizer_id: Optional[String] = None,
api_key_required: Optional[Boolean] = None,
operation_name: Optional[String] = None,
request_parameters: Optional[MapOfStringToBoolean] = None,
request_models: Optional[MapOfStringToString] = None,
request_validator_id: Optional[String] = None,
authorization_scopes: Optional[ListOfString] = None,
) -> Method
Add a method to an existing Resource resource.
Parameters:
-
rest_api_id(String) –The string identifier of the associated RestApi.
-
resource_id(String) –The Resource identifier for the new Method resource.
-
http_method(String) –Specifies the method request's HTTP method type.
-
authorization_type(String) –The method's authorization type. Valid values are
NONEfor open access,AWS_IAMfor using AWS IAM permissions,CUSTOMfor using a custom authorizer, orCOGNITO_USER_POOLSfor using a Cognito user pool. -
authorizer_id(Optional[String], default:None) –Specifies the identifier of an Authorizer to use on this Method, if the type is CUSTOM or COGNITO_USER_POOLS. The authorizer identifier is generated by API Gateway when you created the authorizer.
-
api_key_required(Optional[Boolean], default:None) –Specifies whether the method required a valid ApiKey.
-
operation_name(Optional[String], default:None) –A human-friendly operation identifier for the method. For example, you can assign the
operationNameofListPetsfor theGET /petsmethod in thePetStoreexample. -
request_parameters(Optional[MapOfStringToBoolean], default:None) –A key-value map defining required or optional method request parameters that can be accepted by API Gateway. A key defines a method request parameter name matching the pattern of
method.request.{location}.{name}, wherelocationisquerystring,path, orheaderandnameis a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required (true) or optional (false). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or body-mapping templates. -
request_models(Optional[MapOfStringToString], default:None) –Specifies the Model resources used for the request's content type. Request models are represented as a key/value map, with a content type as the key and a Model name as the value.
-
request_validator_id(Optional[String], default:None) –The identifier of a RequestValidator for validating the method request.
-
authorization_scopes(Optional[ListOfString], default:None) –A list of authorization scopes configured on the method. The scopes are used with a
COGNITO_USER_POOLSauthorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.
Raises:
-
BadRequestException–The submitted request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.
-
ConflictException–The request configuration has conflicts. For details, see the accompanying error message.
-
LimitExceededException–The request exceeded the rate limit. Retry after the specified time period.
-
NotFoundException–The requested resource is not found. Make sure that the request URI is correct.
-
TooManyRequestsException–The request has reached its throttling limit. Retry after the specified time period.
-
UnauthorizedException–The request is denied because the caller has insufficient permissions.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_api_gateway/_services/api_gateway.py
6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 | |