Skip to content

Commit

Permalink
Merge pull request #896 from kokobd/fix-dynamodb-get-item
Browse files Browse the repository at this point in the history
Change Item in GetItemResponse to optional
  • Loading branch information
endgame authored Feb 18, 2023
2 parents f610f8c + e65a66c commit 12e5411
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 21 deletions.
5 changes: 0 additions & 5 deletions configs/services/dynamodb.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@
"underive": []
}
},
"GetItemOutput": {
"requiredFields": [
"Item"
]
},
"PutRequest": {
"replacedBy": {
"name": "",
Expand Down
30 changes: 15 additions & 15 deletions lib/services/amazonka-dynamodb/gen/Amazonka/DynamoDB/GetItem.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ module Amazonka.DynamoDB.GetItem

-- * Response Lenses
getItemResponse_consumedCapacity,
getItemResponse_httpStatus,
getItemResponse_item,
getItemResponse_httpStatus,
)
where

Expand Down Expand Up @@ -325,8 +325,8 @@ instance Core.AWSRequest GetItem where
( \s h x ->
GetItemResponse'
Prelude.<$> (x Data..?> "ConsumedCapacity")
Prelude.<*> (Prelude.pure (Prelude.fromEnum s))
Prelude.<*> (x Data..?> "Item" Core..!@ Prelude.mempty)
Prelude.<*> (Prelude.pure (Prelude.fromEnum s))
)

instance Prelude.Hashable GetItem where
Expand Down Expand Up @@ -399,11 +399,11 @@ data GetItemResponse = GetItemResponse'
-- <https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html Read\/Write Capacity Mode>
-- in the /Amazon DynamoDB Developer Guide/.
consumedCapacity :: Prelude.Maybe ConsumedCapacity,
-- | The response's http status code.
httpStatus :: Prelude.Int,
-- | A map of attribute names to @AttributeValue@ objects, as specified by
-- @ProjectionExpression@.
item :: Prelude.HashMap Prelude.Text AttributeValue
item :: Prelude.Maybe (Prelude.HashMap Prelude.Text AttributeValue),
-- | The response's http status code.
httpStatus :: Prelude.Int
}
deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)

Expand All @@ -423,10 +423,10 @@ data GetItemResponse = GetItemResponse'
-- <https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html Read\/Write Capacity Mode>
-- in the /Amazon DynamoDB Developer Guide/.
--
-- 'httpStatus', 'getItemResponse_httpStatus' - The response's http status code.
--
-- 'item', 'getItemResponse_item' - A map of attribute names to @AttributeValue@ objects, as specified by
-- @ProjectionExpression@.
--
-- 'httpStatus', 'getItemResponse_httpStatus' - The response's http status code.
newGetItemResponse ::
-- | 'httpStatus'
Prelude.Int ->
Expand All @@ -435,8 +435,8 @@ newGetItemResponse pHttpStatus_ =
GetItemResponse'
{ consumedCapacity =
Prelude.Nothing,
httpStatus = pHttpStatus_,
item = Prelude.mempty
item = Prelude.Nothing,
httpStatus = pHttpStatus_
}

-- | The capacity units consumed by the @GetItem@ operation. The data
Expand All @@ -449,17 +449,17 @@ newGetItemResponse pHttpStatus_ =
getItemResponse_consumedCapacity :: Lens.Lens' GetItemResponse (Prelude.Maybe ConsumedCapacity)
getItemResponse_consumedCapacity = Lens.lens (\GetItemResponse' {consumedCapacity} -> consumedCapacity) (\s@GetItemResponse' {} a -> s {consumedCapacity = a} :: GetItemResponse)

-- | A map of attribute names to @AttributeValue@ objects, as specified by
-- @ProjectionExpression@.
getItemResponse_item :: Lens.Lens' GetItemResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text AttributeValue))
getItemResponse_item = Lens.lens (\GetItemResponse' {item} -> item) (\s@GetItemResponse' {} a -> s {item = a} :: GetItemResponse) Prelude.. Lens.mapping Lens.coerced

-- | The response's http status code.
getItemResponse_httpStatus :: Lens.Lens' GetItemResponse Prelude.Int
getItemResponse_httpStatus = Lens.lens (\GetItemResponse' {httpStatus} -> httpStatus) (\s@GetItemResponse' {} a -> s {httpStatus = a} :: GetItemResponse)

-- | A map of attribute names to @AttributeValue@ objects, as specified by
-- @ProjectionExpression@.
getItemResponse_item :: Lens.Lens' GetItemResponse (Prelude.HashMap Prelude.Text AttributeValue)
getItemResponse_item = Lens.lens (\GetItemResponse' {item} -> item) (\s@GetItemResponse' {} a -> s {item = a} :: GetItemResponse) Prelude.. Lens.coerced

instance Prelude.NFData GetItemResponse where
rnf GetItemResponse' {..} =
Prelude.rnf consumedCapacity
`Prelude.seq` Prelude.rnf httpStatus
`Prelude.seq` Prelude.rnf item
`Prelude.seq` Prelude.rnf httpStatus
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ module Amazonka.DynamoDB.Lens
getItem_tableName,
getItem_key,
getItemResponse_consumedCapacity,
getItemResponse_httpStatus,
getItemResponse_item,
getItemResponse_httpStatus,

-- ** ImportTable
importTable_clientToken,
Expand Down

0 comments on commit 12e5411

Please sign in to comment.