Skip to content

Commit 1016622

Browse files
committed
feat(batch-get.request): method to set ReturnConsumedCapacity
1 parent 661cda7 commit 1016622

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/dynamo/batchget/batch-get.request.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ describe('batch get', () => {
3535
},
3636
])
3737
})
38+
39+
it('returnConsumedCapacity', () => {
40+
request.returnConsumedCapacity('TOTAL')
41+
expect(request.params.ReturnConsumedCapacity).toBe('TOTAL')
42+
})
3843
})
3944

4045
describe('forModel', () => {

src/dynamo/batchget/batch-get.request.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ export class BatchGetRequest {
2424
}
2525
}
2626

27+
returnConsumedCapacity(level: DynamoDB.ReturnConsumedCapacity): BatchGetRequest {
28+
this.params.ReturnConsumedCapacity = level
29+
return this
30+
}
31+
2732
/**
2833
* @param {ModelConstructor<T>} modelClazz
2934
* @param {Partial<T>[]} keys a partial of T that contains Partition key and SortKey (if necessary). Throws if missing.

0 commit comments

Comments
 (0)