public Request<UpdateMethodRequest> marshall(UpdateMethodRequest updateMethodRequest) {

    if (updateMethodRequest == null) {
      throw new SdkClientException("Invalid argument passed to marshall(...)");
    }

    Request<UpdateMethodRequest> request =
        new DefaultRequest<UpdateMethodRequest>(updateMethodRequest, "AmazonApiGateway");

    request.setHttpMethod(HttpMethodName.PATCH);

    String uriResourcePath = "/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}";

    uriResourcePath =
        com.amazonaws.transform.PathMarshallers.NON_GREEDY.marshall(
            uriResourcePath, "restapi_id", updateMethodRequest.getRestApiId());
    uriResourcePath =
        com.amazonaws.transform.PathMarshallers.NON_GREEDY.marshall(
            uriResourcePath, "resource_id", updateMethodRequest.getResourceId());
    uriResourcePath =
        com.amazonaws.transform.PathMarshallers.NON_GREEDY.marshall(
            uriResourcePath, "http_method", updateMethodRequest.getHttpMethod());
    request.setResourcePath(uriResourcePath);

    try {
      final StructuredJsonGenerator jsonGenerator = protocolFactory.createGenerator();
      jsonGenerator.writeStartObject();

      java.util.List<PatchOperation> patchOperationsList = updateMethodRequest.getPatchOperations();
      if (patchOperationsList != null) {
        jsonGenerator.writeFieldName("patchOperations");
        jsonGenerator.writeStartArray();
        for (PatchOperation patchOperationsListValue : patchOperationsList) {
          if (patchOperationsListValue != null) {

            PatchOperationJsonMarshaller.getInstance()
                .marshall(patchOperationsListValue, jsonGenerator);
          }
        }
        jsonGenerator.writeEndArray();
      }

      jsonGenerator.writeEndObject();

      byte[] content = jsonGenerator.getBytes();
      request.setContent(new ByteArrayInputStream(content));
      request.addHeader("Content-Length", Integer.toString(content.length));
      if (!request.getHeaders().containsKey("Content-Type")) {
        request.addHeader("Content-Type", protocolFactory.getContentType());
      }
    } catch (Throwable t) {
      throw new SdkClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }

    return request;
  }