- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
UpdateMethodCommand
Updates an existing Method resource.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { APIGatewayClient, UpdateMethodCommand } from "@aws-sdk/client-api-gateway"; // ES Modules import
// const { APIGatewayClient, UpdateMethodCommand } = require("@aws-sdk/client-api-gateway"); // CommonJS import
const client = new APIGatewayClient(config);
const input = { // UpdateMethodRequest
restApiId: "STRING_VALUE", // required
resourceId: "STRING_VALUE", // required
httpMethod: "STRING_VALUE", // required
patchOperations: [ // ListOfPatchOperation
{ // PatchOperation
op: "add" || "remove" || "replace" || "move" || "copy" || "test",
path: "STRING_VALUE",
value: "STRING_VALUE",
from: "STRING_VALUE",
},
],
};
const command = new UpdateMethodCommand(input);
const response = await client.send(command);
// { // Method
// httpMethod: "STRING_VALUE",
// authorizationType: "STRING_VALUE",
// authorizerId: "STRING_VALUE",
// apiKeyRequired: true || false,
// requestValidatorId: "STRING_VALUE",
// operationName: "STRING_VALUE",
// requestParameters: { // MapOfStringToBoolean
// "<keys>": true || false,
// },
// requestModels: { // MapOfStringToString
// "<keys>": "STRING_VALUE",
// },
// methodResponses: { // MapOfMethodResponse
// "<keys>": { // MethodResponse
// statusCode: "STRING_VALUE",
// responseParameters: {
// "<keys>": true || false,
// },
// responseModels: {
// "<keys>": "STRING_VALUE",
// },
// },
// },
// methodIntegration: { // Integration
// type: "HTTP" || "AWS" || "MOCK" || "HTTP_PROXY" || "AWS_PROXY",
// httpMethod: "STRING_VALUE",
// uri: "STRING_VALUE",
// connectionType: "INTERNET" || "VPC_LINK",
// connectionId: "STRING_VALUE",
// credentials: "STRING_VALUE",
// requestParameters: "<MapOfStringToString>",
// requestTemplates: "<MapOfStringToString>",
// passthroughBehavior: "STRING_VALUE",
// contentHandling: "CONVERT_TO_BINARY" || "CONVERT_TO_TEXT",
// timeoutInMillis: Number("int"),
// cacheNamespace: "STRING_VALUE",
// cacheKeyParameters: [ // ListOfString
// "STRING_VALUE",
// ],
// integrationResponses: { // MapOfIntegrationResponse
// "<keys>": { // IntegrationResponse
// statusCode: "STRING_VALUE",
// selectionPattern: "STRING_VALUE",
// responseParameters: "<MapOfStringToString>",
// responseTemplates: "<MapOfStringToString>",
// contentHandling: "CONVERT_TO_BINARY" || "CONVERT_TO_TEXT",
// },
// },
// tlsConfig: { // TlsConfig
// insecureSkipVerification: true || false,
// },
// },
// authorizationScopes: [
// "STRING_VALUE",
// ],
// };
UpdateMethodCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
httpMethod Required | string | undefined | The HTTP verb of the Method resource. |
resourceId Required | string | undefined | The Resource identifier for the Method resource. |
restApiId Required | string | undefined | The string identifier of the associated RestApi. |
patchOperations | PatchOperation[] | undefined | For more information about supported patch operations, see Patch Operations . |
UpdateMethodCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
apiKeyRequired | boolean | undefined | A boolean flag specifying whether a valid ApiKey is required to invoke this method. |
authorizationScopes | string[] | undefined | A list of authorization scopes configured on the method. The scopes are used with a |
authorizationType | string | undefined | The method's authorization type. Valid values are |
authorizerId | string | undefined | The identifier of an Authorizer to use on this method. The |
httpMethod | string | undefined | The method's HTTP verb. |
methodIntegration | Integration | undefined | Gets the method's integration responsible for passing the client-submitted request to the back end and performing necessary transformations to make the request compliant with the back end. |
methodResponses | Record<string, MethodResponse> | undefined | Gets a method response associated with a given HTTP status code. |
operationName | string | undefined | A human-friendly operation identifier for the method. For example, you can assign the |
requestModels | Record<string, string> | undefined | A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key). |
requestParameters | Record<string, boolean> | undefined | A key-value map defining required or optional method request parameters that can be accepted by API Gateway. A key is a method request parameter name matching the pattern of |
requestValidatorId | string | undefined | The identifier of a RequestValidator for request validation. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
BadRequestException | client | The submitted request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details. |
ConflictException | client | The request configuration has conflicts. For details, see the accompanying error message. |
NotFoundException | client | The requested resource is not found. Make sure that the request URI is correct. |
TooManyRequestsException | client | The request has reached its throttling limit. Retry after the specified time period. |
UnauthorizedException | client | The request is denied because the caller has insufficient permissions. |
APIGatewayServiceException | Base exception class for all service exceptions from APIGateway service. |