module import * as DynamoDB from 'aws-sdk/clients/dynamodb' ; import { createLogger , Logger } from '../../../logger/logger' ; import { createKeyAttributes } from '../../../mapper/mapper' ; import { ModelConstructor } from '../../../model/model-constructor' ; import { DynamoDbWrapper } from '../../dynamo-db-wrapper' ; import { prepareAndAddUpdateExpressions } from '../../expression/prepare-and-add-update-expressions.function' ; import { addUpdate } from '../../expression/request-expression-builder' ; import { RequestUpdateFunction } from '../../expression/type/update-expression-definition-chain' ; import { UpdateExpressionDefinitionFunction } from '../../expression/type/update-expression-definition-function' ; import { WriteRequest } from '../write.request' ; /**
 * Request class for the UpdateItem operation.
 */ export class UpdateRequest < T , T2 = void > extends WriteRequest < T , T2 , DynamoDB . UpdateItemInput , DynamoDB . UpdateItemOutput , UpdateRequest < T , T2 > > { protected readonly logger : Logger ; constructor ( dynamoDBWrapper , modelClazz , partitionKey , sortKey ? ) { super ( dynamoDBWrapper , modelClazz ) ; this . logger = createLogger ( 'dynamo.request.UpdateRequest' , modelClazz ) ; this . params . Key = createKeyAttributes ( this . metadata , partitionKey , sortKey ) ; } example updateAttribute < K extends keyof T > ( attributePath ) { return addUpdate ( attributePath , this , this . metadata ) ; } example operations ( ... updateDefFns ) { prepareAndAddUpdateExpressions ( this . metadata , this . params , updateDefFns ) ; return this ; } returnValues ( returnValues ) ; returnValues ( returnValues ) ; returnValues ( returnValues ) ; returnValues ( returnValues ) { this . params . ReturnValues = returnValues ; return this ; } protected doRequest ( params ) { return this . dynamoDBWrapper . updateItem ( this . params ) ; } }