Represents the input of a BatchGetItem operation.


//    err := client.ScanPages(params,
//        func(page *ScanOutput, lastPage bool) bool {
//            pageNum++
//            fmt.Println(page)
//            return pageNum <= 3
//        })
func (c *DynamoDB) ScanPages(input *ScanInput, fn func(p *ScanOutput, lastPage bool) (shouldContinue bool)) error {
	page, _ := c.ScanRequest(input)
	return page.EachPage(func(p interface{}, lastPage bool) bool {
		return fn(p.(*ScanOutput), lastPage)

const opUpdateItem = "UpdateItem"

// UpdateItemRequest generates a "aws/request.Request" representing the
// client's request for the UpdateItem operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// See UpdateItem for usage and error information.
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the UpdateItem method directly
// instead.
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//    // Example sending a request using the UpdateItemRequest method.
//    req, resp := client.UpdateItemRequest(params)
//    err := req.Send()
//    if err == nil { // resp is now filled
//        fmt.Println(resp)
//    }
func (c *DynamoDB) UpdateItemRequest(input *UpdateItemInput) (req *request.Request, output *UpdateItemOutput) {
	op := &request.Operation{
		Name:       opUpdateItem,
		HTTPMethod: "POST",
		HTTPPath:   "/",

	if input == nil {
		input = &UpdateItemInput{}

	req = c.newRequest(op, input, output)
	output = &UpdateItemOutput{}
	req.Data = output

// UpdateItem API operation for Amazon DynamoDB.
// Edits an existing item's attributes, or adds a new item to the table if it
// does not already exist. You can put, delete, or add attribute values. You
// can also perform a conditional update on an existing item (insert a new attribute
// name-value pair if it doesn't exist, or replace an existing name-value pair
// if it has certain expected attribute values).
// You can also return the item's attribute values in the same UpdateItem operation
// using the ReturnValues parameter.
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
// See the AWS API reference guide for Amazon DynamoDB's
// API operation UpdateItem for usage and error information.
// Returned Error Codes:
//   * ConditionalCheckFailedException
//   A condition specified in the operation could not be evaluated.
//   * ProvisionedThroughputExceededException
//   Your request rate is too high. The AWS SDKs for DynamoDB automatically retry
//   requests that receive this exception. Your request is eventually successful,
//   unless your retry queue is too large to finish. Reduce the frequency of requests
//   and use exponential backoff. For more information, go to Error Retries and
//   Exponential Backoff (
//   in the Amazon DynamoDB Developer Guide.
//   * ResourceNotFoundException
//   The operation tried to access a nonexistent table or index. The resource
//   might not be specified correctly, or its status might not be ACTIVE.
//   * ItemCollectionSizeLimitExceededException
//   An item collection is too large. This exception is only returned for tables
//   that have one or more local secondary indexes.
//   * InternalServerError
//   An error occurred on the server side.
func (c *DynamoDB) UpdateItem(input *UpdateItemInput) (*UpdateItemOutput, error) {
	req, out := c.UpdateItemRequest(input)
	err := req.Send()