Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Item in GetItemResponse to optional #896

Merged
merged 2 commits into from
Feb 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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