Request class for the PutItem operation.

### Type parameters

- #### T

### Hierarchy

- WriteRequest<T, PutItemInput, PutItemOutput, PutRequest<T>>
  - PutRequest

## Index

### Constructors

- constructor

### Properties

- dynamoDBWrapper
- logger
- metadata
- modelClazz
- params
- tableName

### Methods

- doRequest
- exec
- execFullResponse
- execNoMap
- ifNotExists
- onlyIf
- onlyIfAttribute
- returnConsumedCapacity
- returnItemCollectionMetrics
- returnValues

## Constructors

### constructor

- new PutRequest(dynamoDBWrapper: DynamoDbWrapper, modelClazz: ModelConstructor<T>, item: T): PutRequest

- Overrides WriteRequest.constructor

  - Defined in dynamo/request/put/put.request.ts:23

  #### Parameters

  - ##### dynamoDBWrapper: DynamoDbWrapper

  - ##### modelClazz: ModelConstructor<T>

  - ##### item: T

  #### Returns PutRequest

## Properties

### dynamoDBWrapper

dynamoDBWrapper: DynamoDbWrapper

Inherited from BaseRequest.dynamoDBWrapper

- Defined in dynamo/request/base.request.ts:29

### Protected logger

logger: Logger

Overrides WriteRequest.logger

- Defined in dynamo/request/put/put.request.ts:23

### metadata

metadata: Metadata<T>

Inherited from BaseRequest.metadata

- Defined in dynamo/request/base.request.ts:39

metadata created from modelClazz

### modelClazz

modelClazz: ModelConstructor<T>

Inherited from BaseRequest.modelClazz

- Defined in dynamo/request/base.request.ts:34

corresponding Model Class

### params

params: PutItemInput

Inherited from BaseRequest.params

- Defined in dynamo/request/base.request.ts:49

request input object

### tableName

tableName: string

Inherited from BaseRequest.tableName

- Defined in dynamo/request/base.request.ts:44

tableName created with configured tableNameResolver function

## Methods

### Protected doRequest

- doRequest(params: PutItemInput): Promise<PutItemOutput>

- Overrides WriteRequest.doRequest

  - Defined in dynamo/request/put/put.request.ts:48

  #### Parameters

  - ##### params: PutItemInput

  #### Returns Promise<PutItemOutput>

### exec

- exec(): Promise<void>

- Inherited from WriteRequest.exec

  Overrides BaseRequest.exec

  - Defined in dynamo/request/write.request.ts:74

  #### Returns Promise<void>

  if no ReturnValues are requested, { T } if the requested ReturnValues are ALL_OLD|ALL_NEW or {Partial} if the requested ReturnValues are UPDATED_OLD|UPDATED_NEW

### execFullResponse

- execFullResponse(): Promise<WriteResponse<PutItemOutput, T>>

- Inherited from WriteRequest.execFullResponse

  Overrides BaseRequest.execFullResponse

  - Defined in dynamo/request/write.request.ts:86

  execute request and return the full response

  #### Returns Promise<WriteResponse<PutItemOutput, T>>

### execNoMap

- execNoMap(): Promise<PutItemOutput>

- Inherited from WriteRequest.execNoMap

  - Defined in dynamo/request/write.request.ts:109

  execute request without parsing (mapping) the response attributes to js objects

  #### Returns Promise<PutItemOutput>

### ifNotExists

- ifNotExists(predicate?: boolean): PutRequest<T>

- - Defined in dynamo/request/put/put.request.ts:34

  Adds a condition expression to the request, which makes sure the item will only be saved if the id does not exist

  #### Parameters

  - ##### Default value predicate: boolean = true

  #### Returns PutRequest<T>

### onlyIf

- onlyIf(...conditionDefFns: ConditionExpressionDefinitionFunction[]): PutRequest<T>

- Inherited from WriteRequest.onlyIf

  - Defined in dynamo/request/write.request.ts:65
  example

    writeRequest.onlyIf( attribute('age').eq(23) )

  example

    writeRequest.onlyIf( or( attribute('age').lt(18), attribute('age').gt(65) ) )

  #### Parameters

  - ##### Rest ...conditionDefFns: ConditionExpressionDefinitionFunction[]

  #### Returns PutRequest<T>

### onlyIfAttribute

- onlyIfAttribute<K>(attributePath: K): RequestConditionFunctionTyped<PutRequest<T>, T, K>
- onlyIfAttribute(attributePath: string): RequestConditionFunction<PutRequest<T>, T>

- Inherited from WriteRequest.onlyIfAttribute

  - Defined in dynamo/request/write.request.ts:55

  add a condition for propertyPath

  #### Type parameters

  - #### K: keyof T

  #### Parameters

  - ##### attributePath: K

  #### Returns RequestConditionFunctionTyped<PutRequest<T>, T, K>

- Inherited from WriteRequest.onlyIfAttribute

  - Defined in dynamo/request/write.request.ts:56

  #### Parameters

  - ##### attributePath: string

  #### Returns RequestConditionFunction<PutRequest<T>, T>

### returnConsumedCapacity

- returnConsumedCapacity(level: DynamoDB.ReturnConsumedCapacity): PutRequest<T>

- Inherited from BaseRequest.returnConsumedCapacity

  - Defined in dynamo/request/base.request.ts:75

  return ConsumedCapacity of the corresponding table(s) in the response

  #### Parameters

  - ##### level: DynamoDB.ReturnConsumedCapacity

    not all requests support all values

  #### Returns PutRequest<T>

### returnItemCollectionMetrics

- returnItemCollectionMetrics(returnItemCollectionMetrics: DynamoDB.ReturnItemCollectionMetrics): PutRequest<T>

- Inherited from WriteRequest.returnItemCollectionMetrics

  - Defined in dynamo/request/write.request.ts:46

  return item collection metrics.

  #### Parameters

  - ##### returnItemCollectionMetrics: DynamoDB.ReturnItemCollectionMetrics

  #### Returns PutRequest<T>

### returnValues

- returnValues(returnValues: "ALL_OLD"): PutRequestReturnT<T>
- returnValues(returnValues: "NONE"): PutRequest<T>

- - Defined in dynamo/request/put/put.request.ts:41

  #### Parameters

  - ##### returnValues: "ALL_OLD"

  #### Returns PutRequestReturnT<T>

- - Defined in dynamo/request/put/put.request.ts:42

  #### Parameters

  - ##### returnValues: "NONE"

  #### Returns PutRequest<T>