amazonka-dynamodb 0.2.2 → 0.2.3
raw patch · 14 files changed
+465/−147 lines, 14 filesdep ~amazonka-corePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: amazonka-core
API changes (from Hackage documentation)
+ Network.AWS.DynamoDB.Types: cgsiaIndexName :: Lens' CreateGlobalSecondaryIndexAction Text
+ Network.AWS.DynamoDB.Types: cgsiaKeySchema :: Lens' CreateGlobalSecondaryIndexAction (NonEmpty KeySchemaElement)
+ Network.AWS.DynamoDB.Types: cgsiaProjection :: Lens' CreateGlobalSecondaryIndexAction Projection
+ Network.AWS.DynamoDB.Types: cgsiaProvisionedThroughput :: Lens' CreateGlobalSecondaryIndexAction ProvisionedThroughput
+ Network.AWS.DynamoDB.Types: createGlobalSecondaryIndexAction :: Text -> NonEmpty KeySchemaElement -> Projection -> ProvisionedThroughput -> CreateGlobalSecondaryIndexAction
+ Network.AWS.DynamoDB.Types: data CreateGlobalSecondaryIndexAction
+ Network.AWS.DynamoDB.Types: data DeleteGlobalSecondaryIndexAction
+ Network.AWS.DynamoDB.Types: deleteGlobalSecondaryIndexAction :: Text -> DeleteGlobalSecondaryIndexAction
+ Network.AWS.DynamoDB.Types: dgsiaIndexName :: Lens' DeleteGlobalSecondaryIndexAction Text
+ Network.AWS.DynamoDB.Types: gsidBackfilling :: Lens' GlobalSecondaryIndexDescription (Maybe Bool)
+ Network.AWS.DynamoDB.Types: gsiuCreate :: Lens' GlobalSecondaryIndexUpdate (Maybe CreateGlobalSecondaryIndexAction)
+ Network.AWS.DynamoDB.Types: gsiuDelete :: Lens' GlobalSecondaryIndexUpdate (Maybe DeleteGlobalSecondaryIndexAction)
+ Network.AWS.DynamoDB.Types: instance Eq CreateGlobalSecondaryIndexAction
+ Network.AWS.DynamoDB.Types: instance Eq DeleteGlobalSecondaryIndexAction
+ Network.AWS.DynamoDB.Types: instance FromJSON CreateGlobalSecondaryIndexAction
+ Network.AWS.DynamoDB.Types: instance FromJSON DeleteGlobalSecondaryIndexAction
+ Network.AWS.DynamoDB.Types: instance IsString DeleteGlobalSecondaryIndexAction
+ Network.AWS.DynamoDB.Types: instance Monoid DeleteGlobalSecondaryIndexAction
+ Network.AWS.DynamoDB.Types: instance Ord DeleteGlobalSecondaryIndexAction
+ Network.AWS.DynamoDB.Types: instance Read CreateGlobalSecondaryIndexAction
+ Network.AWS.DynamoDB.Types: instance Read DeleteGlobalSecondaryIndexAction
+ Network.AWS.DynamoDB.Types: instance Show CreateGlobalSecondaryIndexAction
+ Network.AWS.DynamoDB.Types: instance Show DeleteGlobalSecondaryIndexAction
+ Network.AWS.DynamoDB.Types: instance ToJSON CreateGlobalSecondaryIndexAction
+ Network.AWS.DynamoDB.Types: instance ToJSON DeleteGlobalSecondaryIndexAction
+ Network.AWS.DynamoDB.UpdateTable: utAttributeDefinitions :: Lens' UpdateTable [AttributeDefinition]
Files
- amazonka-dynamodb.cabal +2/−2
- gen/Network/AWS/DynamoDB/BatchWriteItem.hs +2/−0
- gen/Network/AWS/DynamoDB/CreateTable.hs +3/−3
- gen/Network/AWS/DynamoDB/DeleteItem.hs +31/−14
- gen/Network/AWS/DynamoDB/DeleteTable.hs +3/−0
- gen/Network/AWS/DynamoDB/DescribeTable.hs +8/−0
- gen/Network/AWS/DynamoDB/GetItem.hs +9/−6
- gen/Network/AWS/DynamoDB/ListTables.hs +1/−1
- gen/Network/AWS/DynamoDB/PutItem.hs +35/−14
- gen/Network/AWS/DynamoDB/Query.hs +44/−34
- gen/Network/AWS/DynamoDB/Scan.hs +19/−15
- gen/Network/AWS/DynamoDB/Types.hs +215/−17
- gen/Network/AWS/DynamoDB/UpdateItem.hs +56/−25
- gen/Network/AWS/DynamoDB/UpdateTable.hs +37/−16
amazonka-dynamodb.cabal view
@@ -1,5 +1,5 @@ name: amazonka-dynamodb-version: 0.2.2+version: 0.2.3 synopsis: Amazon DynamoDB SDK. homepage: https://github.com/brendanhay/amazonka license: OtherLicense@@ -58,5 +58,5 @@ other-modules: build-depends:- amazonka-core == 0.2.2.*+ amazonka-core == 0.2.3.* , base >= 4.7 && < 5
gen/Network/AWS/DynamoDB/BatchWriteItem.hs view
@@ -27,6 +27,8 @@ -- can comprise as many as 25 put or delete requests. Individual items to be -- written can be as large as 400 KB. --+-- /BatchWriteItem/ cannot update items. To update items, use the /UpdateItem/ API.+-- -- The individual /PutItem/ and /DeleteItem/ operations specified in /BatchWriteItem/ -- are atomic; however /BatchWriteItem/ as a whole is not. If any requested -- operations fail because the table's provisioned throughput is exceeded or an
gen/Network/AWS/DynamoDB/CreateTable.hs view
@@ -30,9 +30,9 @@ -- request, DynamoDB immediately returns a response with a /TableStatus/ of 'CREATING'. After the table is created, DynamoDB sets the /TableStatus/ to 'ACTIVE'. You -- can perform read and write operations only on an 'ACTIVE' table. ----- If you want to create multiple tables with secondary indexes on them, you--- must create them sequentially. Only one table with secondary indexes can be--- in the 'CREATING' state at any given time.+-- You can optionally define secondary indexes on the new table, as part of the /CreateTable/ operation. If you want to create multiple tables with secondary+-- indexes on them, you must create the tables sequentially. Only one table with+-- secondary indexes can be in the 'CREATING' state at any given time. -- -- You can use the /DescribeTable/ API to check the table status. --
gen/Network/AWS/DynamoDB/DeleteItem.hs view
@@ -128,13 +128,16 @@ -- -- An expression can contain any of the following: ----- Boolean functions: 'ATTRIBUTE_EXIST | CONTAINS | BEGINS_WITH'+-- Boolean functions: 'attribute_exists | attribute_not_exists | contains |begins_with' ----- Comparison operators: ' = | <> | < | > | <= | >= | BETWEEN | IN'+-- These function names are case-sensitive. ----- Logical operators: 'NOT | AND | OR'+-- Comparison operators: ' = | <> | < | > | <= | >= | BETWEEN | IN' --+-- Logical operators: 'AND | OR | NOT' --+-- For more information on condition expressions, go to <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html Specifying Conditions>+-- in the /Amazon DynamoDB Developer Guide/. diConditionExpression :: Lens' DeleteItem (Maybe Text) diConditionExpression = lens _diConditionExpression (\s a -> s { _diConditionExpression = a })@@ -192,7 +195,7 @@ -- For type Number, value comparisons are numeric. -- -- String value comparisons for greater than, equals, or less than are based on--- ASCII character code values. For example, 'a' is greater than 'A', and 'aa' is+-- ASCII character code values. For example, 'a' is greater than 'A', and 'a' is -- greater than 'B'. For a list of code values, see <http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters>. -- -- For type Binary, DynamoDB treats each byte of the binary data as unsigned@@ -261,9 +264,19 @@ -- 'NOT_NULL' : The attribute exists. 'NOT_NULL' is supported for all datatypes, -- including lists and maps. --+-- This operator tests for the existence of an attribute, not its data type. If+-- the data type of attribute "'a'" is null, and you evaluate it using 'NOT_NULL',+-- the result is a Boolean /true/. This result is because the attribute "'a'"+-- exists; its data type is not relevant to the 'NOT_NULL' comparison operator.+-- -- 'NULL' : The attribute does not exist. 'NULL' is supported for all datatypes, -- including lists and maps. --+-- This operator tests for the nonexistence of an attribute, not its data type.+-- If the data type of attribute "'a'" is null, and you evaluate it using 'NULL',+-- the result is a Boolean /false/. This is because the attribute "'a'" exists; its+-- data type is not relevant to the 'NULL' comparison operator.+-- -- 'CONTAINS' : Checks for a subsequence, or value in a set. -- -- /AttributeValueList/ can contain only one /AttributeValue/ element of type@@ -335,6 +348,8 @@ -- is valid and the condition evaluates to true. If the value is found, despite -- the assumption that it does not exist, the condition evaluates to false. --+-- Note that the default value for /Exists/ is 'true'.+-- -- The /Value/ and /Exists/ parameters are incompatible with /AttributeValueList/ -- and /ComparisonOperator/. Note that if you use both sets of parameters at once, -- DynamoDB will return a /ValidationException/ exception.@@ -342,7 +357,7 @@ diExpected = lens _diExpected (\s a -> s { _diExpected = a }) . _Map -- | One or more substitution tokens for simplifying complex expressions. The--- following are some use cases for an /ExpressionAttributeNames/ value:+-- following are some use cases for using /ExpressionAttributeNames/: -- -- To shorten an attribute name that is very long or unwieldy in an -- expression.@@ -360,12 +375,13 @@ -- -- Now suppose that you specified the following for /ExpressionAttributeNames/: ----- '{"n":"order.customerInfo.LastName"}'+-- '{"#name":"order.customerInfo.LastName"}' -- -- The expression can now be simplified as follows: ----- '#n = "Smith" OR #n = "Jones"'+-- '#name = "Smith" OR #name = "Jones"' --+-- For more information on expression attribute names, go to <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html Accessing ItemAttributes> in the /Amazon DynamoDB Developer Guide/. diExpressionAttributeNames :: Lens' DeleteItem (HashMap Text Text) diExpressionAttributeNames = lens _diExpressionAttributeNames@@ -374,19 +390,20 @@ -- | One or more values that can be substituted in an expression. ----- Use the : character in an expression to dereference an attribute value. For--- example, consider the following expression:+-- Use the : (colon) character in an expression to dereference an attribute+-- value. For example, suppose that you wanted to check whether the value of the /ProductStatus/ attribute was one of the following: ----- 'ProductStatus IN ("Available","Backordered","Discontinued")'+-- 'Available | Backordered | Discontinued' ----- Now suppose that you specified the following for /ExpressionAttributeValues/:+-- You would first need to specify /ExpressionAttributeValues/ as follows: ----- '{ "a":{"S":"Available"}, "b":{"S":"Backordered"}, "d":{"S":"Discontinued"} }'+-- '{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"},":disc":{"S":"Discontinued"} }' ----- The expression can now be simplified as follows:+-- You could then use these values in an expression, such as this: ----- 'ProductStatus IN (:a,:b,:c)'+-- 'ProductStatus IN (:avail, :back, :disc)' --+-- For more information on expression attribute values, go to <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html SpecifyingConditions> in the /Amazon DynamoDB Developer Guide/. diExpressionAttributeValues :: Lens' DeleteItem (HashMap Text AttributeValue) diExpressionAttributeValues = lens _diExpressionAttributeValues
gen/Network/AWS/DynamoDB/DeleteTable.hs view
@@ -26,6 +26,9 @@ -- completes the deletion. If the table is in the 'ACTIVE' state, you can delete -- it. If a table is in 'CREATING' or 'UPDATING' states, then DynamoDB returns a /ResourceInUseException/. If the specified table does not exist, DynamoDB returns a /ResourceNotFoundException/. If table is already in the 'DELETING' state, no error is returned. --+-- DynamoDB might continue to accept data read and write operations, such as /GetItem/ and /PutItem/, on a table in the 'DELETING' state until the table deletion is+-- complete.+-- -- When you delete a table, any indexes on that table are also deleted. -- -- Use the /DescribeTable/ API to check the status of the table.
gen/Network/AWS/DynamoDB/DescribeTable.hs view
@@ -26,6 +26,14 @@ -- table, when it was created, the primary key schema, and any indexes on the -- table. --+-- If you issue a DescribeTable request immediately after a CreateTable+-- request, DynamoDB might return a ResourceNotFoundException. This is because+-- DescribeTable uses an eventually consistent query, and the metadata for your+-- table might not be available at that moment. Wait for a few seconds, and then+-- try the DescribeTable request again.+--+--+-- -- <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeTable.html> module Network.AWS.DynamoDB.DescribeTable (
gen/Network/AWS/DynamoDB/GetItem.hs view
@@ -126,7 +126,7 @@ giConsistentRead = lens _giConsistentRead (\s a -> s { _giConsistentRead = a }) -- | One or more substitution tokens for simplifying complex expressions. The--- following are some use cases for an /ExpressionAttributeNames/ value:+-- following are some use cases for using /ExpressionAttributeNames/: -- -- To shorten an attribute name that is very long or unwieldy in an -- expression.@@ -144,12 +144,13 @@ -- -- Now suppose that you specified the following for /ExpressionAttributeNames/: ----- '{"n":"order.customerInfo.LastName"}'+-- '{"#name":"order.customerInfo.LastName"}' -- -- The expression can now be simplified as follows: ----- '#n = "Smith" OR #n = "Jones"'+-- '#name = "Smith" OR #name = "Jones"' --+-- For more information on expression attribute names, go to <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html Accessing ItemAttributes> in the /Amazon DynamoDB Developer Guide/. giExpressionAttributeNames :: Lens' GetItem (HashMap Text Text) giExpressionAttributeNames = lens _giExpressionAttributeNames@@ -166,13 +167,15 @@ giKey :: Lens' GetItem (HashMap Text AttributeValue) giKey = lens _giKey (\s a -> s { _giKey = a }) . _Map --- | One or more attributes to retrieve from the table. These attributes can--- include scalars, sets, or elements of a JSON document. The attributes in the--- expression must be separated by commas.+-- | A string that identifies one or more attributes to retrieve from the table.+-- These attributes can include scalars, sets, or elements of a JSON document.+-- The attributes in the expression must be separated by commas. -- -- If no attribute names are specified, then all attributes will be returned. -- If any of the requested attributes are not found, they will not appear in the -- result.+--+-- For more information on projection expressions, go to <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html Accessing ItemAttributes> in the /Amazon DynamoDB Developer Guide/. giProjectionExpression :: Lens' GetItem (Maybe Text) giProjectionExpression = lens _giProjectionExpression (\s a -> s { _giProjectionExpression = a })
gen/Network/AWS/DynamoDB/ListTables.hs view
@@ -150,6 +150,6 @@ instance AWSPager ListTables where page rq rs- | stop (rq ^. ltExclusiveStartTableName) = Nothing+ | stop (rs ^. ltrLastEvaluatedTableName) = Nothing | otherwise = (\x -> rq & ltExclusiveStartTableName ?~ x) <$> (rs ^. ltrLastEvaluatedTableName)
gen/Network/AWS/DynamoDB/PutItem.hs view
@@ -42,6 +42,10 @@ -- (before the update) or a copy of the updated item (after the update). For -- more information, see the /ReturnValues/ description below. --+-- To prevent a new item from replacing an existing item, use a conditional+-- put operation with /ComparisonOperator/ set to 'NULL' for the primary key+-- attribute, or attributes.+-- -- For more information about using this API, see <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithItems.html Working with Items> in the /Amazon DynamoDB Developer Guide/. -- -- <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html>@@ -135,13 +139,16 @@ -- -- An expression can contain any of the following: ----- Boolean functions: 'ATTRIBUTE_EXIST | CONTAINS | BEGINS_WITH'+-- Boolean functions: 'attribute_exists | attribute_not_exists | contains |begins_with' ----- Comparison operators: ' = | <> | < | > | <= | >= | BETWEEN | IN'+-- These function names are case-sensitive. ----- Logical operators: 'NOT | AND | OR'+-- Comparison operators: ' = | <> | < | > | <= | >= | BETWEEN | IN' --+-- Logical operators: 'AND | OR | NOT' --+-- For more information on condition expressions, go to <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html Specifying Conditions>+-- in the /Amazon DynamoDB Developer Guide/. piConditionExpression :: Lens' PutItem (Maybe Text) piConditionExpression = lens _piConditionExpression (\s a -> s { _piConditionExpression = a })@@ -199,7 +206,7 @@ -- For type Number, value comparisons are numeric. -- -- String value comparisons for greater than, equals, or less than are based on--- ASCII character code values. For example, 'a' is greater than 'A', and 'aa' is+-- ASCII character code values. For example, 'a' is greater than 'A', and 'a' is -- greater than 'B'. For a list of code values, see <http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters>. -- -- For type Binary, DynamoDB treats each byte of the binary data as unsigned@@ -268,9 +275,19 @@ -- 'NOT_NULL' : The attribute exists. 'NOT_NULL' is supported for all datatypes, -- including lists and maps. --+-- This operator tests for the existence of an attribute, not its data type. If+-- the data type of attribute "'a'" is null, and you evaluate it using 'NOT_NULL',+-- the result is a Boolean /true/. This result is because the attribute "'a'"+-- exists; its data type is not relevant to the 'NOT_NULL' comparison operator.+-- -- 'NULL' : The attribute does not exist. 'NULL' is supported for all datatypes, -- including lists and maps. --+-- This operator tests for the nonexistence of an attribute, not its data type.+-- If the data type of attribute "'a'" is null, and you evaluate it using 'NULL',+-- the result is a Boolean /false/. This is because the attribute "'a'" exists; its+-- data type is not relevant to the 'NULL' comparison operator.+-- -- 'CONTAINS' : Checks for a subsequence, or value in a set. -- -- /AttributeValueList/ can contain only one /AttributeValue/ element of type@@ -342,6 +359,8 @@ -- is valid and the condition evaluates to true. If the value is found, despite -- the assumption that it does not exist, the condition evaluates to false. --+-- Note that the default value for /Exists/ is 'true'.+-- -- The /Value/ and /Exists/ parameters are incompatible with /AttributeValueList/ -- and /ComparisonOperator/. Note that if you use both sets of parameters at once, -- DynamoDB will return a /ValidationException/ exception.@@ -349,7 +368,7 @@ piExpected = lens _piExpected (\s a -> s { _piExpected = a }) . _Map -- | One or more substitution tokens for simplifying complex expressions. The--- following are some use cases for an /ExpressionAttributeNames/ value:+-- following are some use cases for using /ExpressionAttributeNames/: -- -- To shorten an attribute name that is very long or unwieldy in an -- expression.@@ -367,12 +386,13 @@ -- -- Now suppose that you specified the following for /ExpressionAttributeNames/: ----- '{"n":"order.customerInfo.LastName"}'+-- '{"#name":"order.customerInfo.LastName"}' -- -- The expression can now be simplified as follows: ----- '#n = "Smith" OR #n = "Jones"'+-- '#name = "Smith" OR #name = "Jones"' --+-- For more information on expression attribute names, go to <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html Accessing ItemAttributes> in the /Amazon DynamoDB Developer Guide/. piExpressionAttributeNames :: Lens' PutItem (HashMap Text Text) piExpressionAttributeNames = lens _piExpressionAttributeNames@@ -381,19 +401,20 @@ -- | One or more values that can be substituted in an expression. ----- Use the : character in an expression to dereference an attribute value. For--- example, consider the following expression:+-- Use the : (colon) character in an expression to dereference an attribute+-- value. For example, suppose that you wanted to check whether the value of the /ProductStatus/ attribute was one of the following: ----- 'ProductStatus IN ("Available","Backordered","Discontinued")'+-- 'Available | Backordered | Discontinued' ----- Now suppose that you specified the following for /ExpressionAttributeValues/:+-- You would first need to specify /ExpressionAttributeValues/ as follows: ----- '{ "a":{"S":"Available"}, "b":{"S":"Backordered"}, "d":{"S":"Discontinued"} }'+-- '{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"},":disc":{"S":"Discontinued"} }' ----- The expression can now be simplified as follows:+-- You could then use these values in an expression, such as this: ----- 'ProductStatus IN (:a,:b,:c)'+-- 'ProductStatus IN (:avail, :back, :disc)' --+-- For more information on expression attribute values, go to <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html SpecifyingConditions> in the /Amazon DynamoDB Developer Guide/. piExpressionAttributeValues :: Lens' PutItem (HashMap Text AttributeValue) piExpressionAttributeValues = lens _piExpressionAttributeValues
gen/Network/AWS/DynamoDB/Query.hs view
@@ -193,11 +193,7 @@ qAttributesToGet :: Lens' Query (NonEmpty Text) qAttributesToGet = lens _qAttributesToGet (\s a -> s { _qAttributesToGet = a }) . _List1 --- | There is a newer parameter available. Use /ConditionExpression/ instead. Note--- that if you use /ConditionalOperator/ and / ConditionExpression / at the same--- time, DynamoDB will return a /ValidationException/ exception.------ This parameter does not support lists or maps.+-- | This parameter does not support lists or maps. -- -- A logical operator to apply to the conditions in the /QueryFilter/ map: --@@ -234,7 +230,7 @@ . _Map -- | One or more substitution tokens for simplifying complex expressions. The--- following are some use cases for an /ExpressionAttributeNames/ value:+-- following are some use cases for using /ExpressionAttributeNames/: -- -- To shorten an attribute name that is very long or unwieldy in an -- expression.@@ -252,12 +248,13 @@ -- -- Now suppose that you specified the following for /ExpressionAttributeNames/: ----- '{"n":"order.customerInfo.LastName"}'+-- '{"#name":"order.customerInfo.LastName"}' -- -- The expression can now be simplified as follows: ----- '#n = "Smith" OR #n = "Jones"'+-- '#name = "Smith" OR #name = "Jones"' --+-- For more information on expression attribute names, go to <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html Accessing ItemAttributes> in the /Amazon DynamoDB Developer Guide/. qExpressionAttributeNames :: Lens' Query (HashMap Text Text) qExpressionAttributeNames = lens _qExpressionAttributeNames@@ -266,30 +263,35 @@ -- | One or more values that can be substituted in an expression. ----- Use the : character in an expression to dereference an attribute value. For--- example, consider the following expression:+-- Use the : (colon) character in an expression to dereference an attribute+-- value. For example, suppose that you wanted to check whether the value of the /ProductStatus/ attribute was one of the following: ----- 'ProductStatus IN ("Available","Backordered","Discontinued")'+-- 'Available | Backordered | Discontinued' ----- Now suppose that you specified the following for /ExpressionAttributeValues/:+-- You would first need to specify /ExpressionAttributeValues/ as follows: ----- '{ "a":{"S":"Available"}, "b":{"S":"Backordered"}, "d":{"S":"Discontinued"} }'+-- '{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"},":disc":{"S":"Discontinued"} }' ----- The expression can now be simplified as follows:+-- You could then use these values in an expression, such as this: ----- 'ProductStatus IN (:a,:b,:c)'+-- 'ProductStatus IN (:avail, :back, :disc)' --+-- For more information on expression attribute values, go to <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html SpecifyingConditions> in the /Amazon DynamoDB Developer Guide/. qExpressionAttributeValues :: Lens' Query (HashMap Text AttributeValue) qExpressionAttributeValues = lens _qExpressionAttributeValues (\s a -> s { _qExpressionAttributeValues = a }) . _Map --- | A condition that evaluates the query results and returns only the desired--- values.+-- | A condition that evaluates the query results after the items are read and+-- returns only the desired values. -- -- The condition you specify is applied to the items queried; any items that do -- not match the expression are not returned.+--+-- Filter expressions are applied after the items are read, so they do not+-- limit the capacity used. A /FilterExpression/ has the same syntax as a /ConditionExpression/. For more information on expression syntax, go to <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html Specifying Conditions> in+-- the /Amazon DynamoDB Developer Guide/. qFilterExpression :: Lens' Query (Maybe Text) qFilterExpression = lens _qFilterExpression (\s a -> s { _qFilterExpression = a })@@ -304,10 +306,12 @@ -- hash key attribute name and value as an 'EQ' condition. You can optionally -- specify a second condition, referring to the range key attribute. ----- For a query on an index, you can have conditions only on the index key--- attributes. You must specify the index hash attribute name and value as an EQ--- condition. You can optionally specify a second condition, referring to the--- index key range attribute.+-- If you do not specify a range key condition, all items under the hash key+-- will be fetched and processed. Any filters will applied after this. For a+-- query on an index, you can have conditions only on the index key attributes.+-- You must specify the index hash attribute name and value as an EQ condition.+-- You can optionally specify a second condition, referring to the index key+-- range attribute. -- -- Each /KeyConditions/ element consists of an attribute name to compare, along -- with the following:@@ -319,7 +323,7 @@ -- For type Number, value comparisons are numeric. -- -- String value comparisons for greater than, equals, or less than are based on--- ASCII character code values. For example, 'a' is greater than 'A', and 'aa' is+-- ASCII character code values. For example, 'a' is greater than 'A', and 'a' is -- greater than 'B'. For a list of code values, see <http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters>. -- -- For Binary, DynamoDB treats each byte of the binary data as unsigned when it@@ -409,13 +413,15 @@ qLimit :: Lens' Query (Maybe Natural) qLimit = lens _qLimit (\s a -> s { _qLimit = a }) . mapping _Nat --- | One or more attributes to retrieve from the table. These attributes can--- include scalars, sets, or elements of a JSON document. The attributes in the--- expression must be separated by commas.+-- | A string that identifies one or more attributes to retrieve from the table.+-- These attributes can include scalars, sets, or elements of a JSON document.+-- The attributes in the expression must be separated by commas. -- -- If no attribute names are specified, then all attributes will be returned. -- If any of the requested attributes are not found, they will not appear in the -- result.+--+-- For more information on projection expressions, go to <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html Accessing ItemAttributes> in the /Amazon DynamoDB Developer Guide/. qProjectionExpression :: Lens' Query (Maybe Text) qProjectionExpression = lens _qProjectionExpression (\s a -> s { _qProjectionExpression = a })@@ -426,15 +432,19 @@ -- -- This parameter does not support lists or maps. ----- A condition that evaluates the query results and returns only the desired--- values.+-- A condition that evaluates the query results after the items are read and+-- returns only the desired values. ----- If you specify more than one condition in the /QueryFilter/ map, then by--- default all of the conditions must evaluate to true. In other words, the--- conditions are ANDed together. (You can use the /ConditionalOperator/ parameter--- to OR the conditions instead. If you do this, then at least one of the--- conditions must evaluate to true, rather than all of them.)+-- Query filters are applied after the items are read, so they do not limit the+-- capacity used. If you specify more than one condition in the /QueryFilter/ map,+-- then by default all of the conditions must evaluate to true. In other words,+-- the conditions are ANDed together. (You can use the /ConditionalOperator/+-- parameter to OR the conditions instead. If you do this, then at least one of+-- the conditions must evaluate to true, rather than all of them.) --+-- /QueryFilter/ does not allow key attributes. You cannot define a filter+-- condition on a hash key or range key.+-- -- Each /QueryFilter/ element consists of an attribute name to compare, along -- with the following: --@@ -445,7 +455,7 @@ -- For type Number, value comparisons are numeric. -- -- String value comparisons for greater than, equals, or less than are based on--- ASCII character code values. For example, 'a' is greater than 'A', and 'aa' is+-- ASCII character code values. For example, 'a' is greater than 'A', and 'a' is -- greater than 'B'. For a list of code values, see <http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters>. -- -- For type Binary, DynamoDB treats each byte of the binary data as unsigned@@ -646,6 +656,6 @@ instance AWSPager Query where page rq rs- | stop (rq ^. qExclusiveStartKey) = Nothing+ | stop (rs ^. qrLastEvaluatedKey) = Nothing | otherwise = Just $ rq & qExclusiveStartKey .~ rs ^. qrLastEvaluatedKey
gen/Network/AWS/DynamoDB/Scan.hs view
@@ -200,7 +200,7 @@ . _Map -- | One or more substitution tokens for simplifying complex expressions. The--- following are some use cases for an /ExpressionAttributeNames/ value:+-- following are some use cases for using /ExpressionAttributeNames/: -- -- To shorten an attribute name that is very long or unwieldy in an -- expression.@@ -218,12 +218,13 @@ -- -- Now suppose that you specified the following for /ExpressionAttributeNames/: ----- '{"n":"order.customerInfo.LastName"}'+-- '{"#name":"order.customerInfo.LastName"}' -- -- The expression can now be simplified as follows: ----- '#n = "Smith" OR #n = "Jones"'+-- '#name = "Smith" OR #name = "Jones"' --+-- For more information on expression attribute names, go to <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html Accessing ItemAttributes> in the /Amazon DynamoDB Developer Guide/. sExpressionAttributeNames :: Lens' Scan (HashMap Text Text) sExpressionAttributeNames = lens _sExpressionAttributeNames@@ -232,19 +233,20 @@ -- | One or more values that can be substituted in an expression. ----- Use the : character in an expression to dereference an attribute value. For--- example, consider the following expression:+-- Use the : (colon) character in an expression to dereference an attribute+-- value. For example, suppose that you wanted to check whether the value of the /ProductStatus/ attribute was one of the following: ----- 'ProductStatus IN ("Available","Backordered","Discontinued")'+-- 'Available | Backordered | Discontinued' ----- Now suppose that you specified the following for /ExpressionAttributeValues/:+-- You would first need to specify /ExpressionAttributeValues/ as follows: ----- '{ "a":{"S":"Available"}, "b":{"S":"Backordered"}, "d":{"S":"Discontinued"} }'+-- '{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"},":disc":{"S":"Discontinued"} }' ----- The expression can now be simplified as follows:+-- You could then use these values in an expression, such as this: ----- 'ProductStatus IN (:a,:b,:c)'+-- 'ProductStatus IN (:avail, :back, :disc)' --+-- For more information on expression attribute values, go to <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html SpecifyingConditions> in the /Amazon DynamoDB Developer Guide/. sExpressionAttributeValues :: Lens' Scan (HashMap Text AttributeValue) sExpressionAttributeValues = lens _sExpressionAttributeValues@@ -272,13 +274,15 @@ sLimit :: Lens' Scan (Maybe Natural) sLimit = lens _sLimit (\s a -> s { _sLimit = a }) . mapping _Nat --- | One or more attributes to retrieve from the table. These attributes can--- include scalars, sets, or elements of a JSON document. The attributes in the--- expression must be separated by commas.+-- | A string that identifies one or more attributes to retrieve from the table.+-- These attributes can include scalars, sets, or elements of a JSON document.+-- The attributes in the expression must be separated by commas. -- -- If no attribute names are specified, then all attributes will be returned. -- If any of the requested attributes are not found, they will not appear in the -- result.+--+-- For more information on projection expressions, go to <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html Accessing ItemAttributes> in the /Amazon DynamoDB Developer Guide/. sProjectionExpression :: Lens' Scan (Maybe Text) sProjectionExpression = lens _sProjectionExpression (\s a -> s { _sProjectionExpression = a })@@ -312,7 +316,7 @@ -- For type Number, value comparisons are numeric. -- -- String value comparisons for greater than, equals, or less than are based on--- ASCII character code values. For example, 'a' is greater than 'A', and 'aa' is+-- ASCII character code values. For example, 'a' is greater than 'A', and 'a' is -- greater than 'B'. For a list of code values, see <http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters>. -- -- For Binary, DynamoDB treats each byte of the binary data as unsigned when it@@ -501,6 +505,6 @@ instance AWSPager Scan where page rq rs- | stop (rq ^. sExclusiveStartKey) = Nothing+ | stop (rs ^. srLastEvaluatedKey) = Nothing | otherwise = Just $ rq & sExclusiveStartKey .~ rs ^. srLastEvaluatedKey
gen/Network/AWS/DynamoDB/Types.hs view
@@ -142,6 +142,7 @@ -- * GlobalSecondaryIndexDescription , GlobalSecondaryIndexDescription , globalSecondaryIndexDescription+ , gsidBackfilling , gsidIndexName , gsidIndexSizeBytes , gsidIndexStatus@@ -199,6 +200,14 @@ , pNonKeyAttributes , pProjectionType + -- * CreateGlobalSecondaryIndexAction+ , CreateGlobalSecondaryIndexAction+ , createGlobalSecondaryIndexAction+ , cgsiaIndexName+ , cgsiaKeySchema+ , cgsiaProjection+ , cgsiaProvisionedThroughput+ -- * Select , Select (..) @@ -208,6 +217,11 @@ , kseAttributeName , kseKeyType + -- * DeleteGlobalSecondaryIndexAction+ , DeleteGlobalSecondaryIndexAction+ , deleteGlobalSecondaryIndexAction+ , dgsiaIndexName+ -- * DeleteRequest , DeleteRequest , deleteRequest@@ -236,6 +250,8 @@ -- * GlobalSecondaryIndexUpdate , GlobalSecondaryIndexUpdate , globalSecondaryIndexUpdate+ , gsiuCreate+ , gsiuDelete , gsiuUpdate ) where @@ -782,6 +798,12 @@ -- | The global secondary indexes, if any, on the table. Each index is scoped to a -- given hash key value. Each element is composed of: --+-- /Backfilling/ - If true, then the index is currently in the backfilling+-- phase. Backfilling occurs only when a new global secondary index is added to+-- the table; it is the process by which DynamoDB populates the new index with+-- data from the table. (This attribute does not appear for indexes that were+-- created during a /CreateTable/ operation.)+-- -- /IndexName/ - The name of the global secondary index. -- -- /IndexSizeBytes/ - The total size of the global secondary index, in bytes.@@ -1009,7 +1031,7 @@ lens _kaaConsistentRead (\s a -> s { _kaaConsistentRead = a }) -- | One or more substitution tokens for simplifying complex expressions. The--- following are some use cases for an /ExpressionAttributeNames/ value:+-- following are some use cases for using /ExpressionAttributeNames/: -- -- To shorten an attribute name that is very long or unwieldy in an -- expression.@@ -1027,12 +1049,13 @@ -- -- Now suppose that you specified the following for /ExpressionAttributeNames/: ----- '{"n":"order.customerInfo.LastName"}'+-- '{"#name":"order.customerInfo.LastName"}' -- -- The expression can now be simplified as follows: ----- '#n = "Smith" OR #n = "Jones"'+-- '#name = "Smith" OR #name = "Jones"' --+-- For more information on expression attribute names, go to <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html Accessing ItemAttributes> in the /Amazon DynamoDB Developer Guide/. kaaExpressionAttributeNames :: Lens' KeysAndAttributes (HashMap Text Text) kaaExpressionAttributeNames = lens _kaaExpressionAttributeNames@@ -1044,13 +1067,15 @@ kaaKeys :: Lens' KeysAndAttributes (NonEmpty (HashMap Text AttributeValue)) kaaKeys = lens _kaaKeys (\s a -> s { _kaaKeys = a }) . _List1 --- | One or more attributes to retrieve from the table. These attributes can--- include scalars, sets, or elements of a JSON document. The attributes in the--- expression must be separated by commas.+-- | A string that identifies one or more attributes to retrieve from the table.+-- These attributes can include scalars, sets, or elements of a JSON document.+-- The attributes in the expression must be separated by commas. -- -- If no attribute names are specified, then all attributes will be returned. -- If any of the requested attributes are not found, they will not appear in the -- result.+--+-- For more information on projection expressions, go to <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html Accessing ItemAttributes> in the /Amazon DynamoDB Developer Guide/. kaaProjectionExpression :: Lens' KeysAndAttributes (Maybe Text) kaaProjectionExpression = lens _kaaProjectionExpression (\s a -> s { _kaaProjectionExpression = a })@@ -1177,6 +1202,17 @@ -- the /Value/ is mathematically added to the existing attribute. If /Value/ is a -- negative number, then it is subtracted from the existing attribute. --+-- If you use 'ADD' to increment or decrement a number value for an item that+-- doesn't exist before the update, DynamoDB uses 0 as the initial value.+--+-- In addition, if you use 'ADD' to update an existing item, and intend to+-- increment or decrement an attribute value which does not yet exist, DynamoDB+-- uses '0' as the initial value. For example, suppose that the item you want to+-- update does not yet have an attribute named /itemcount/, but you decide to 'ADD'+-- the number '3' to this attribute anyway, even though it currently does not+-- exist. DynamoDB will create the /itemcount/ attribute, set its initial value to '0', and finally add '3' to it. The result will be a new /itemcount/ attribute in+-- the item, with a value of '3'.+-- -- If the existing data type is a set, and if the /Value/ is also a set, then -- the /Value/ is added to the existing set. (This is a /set/ operation, not -- mathematical addition.) For example, if the attribute value was the set '[1,2]', and the@@ -1253,7 +1289,7 @@ -- For type Number, value comparisons are numeric. -- -- String value comparisons for greater than, equals, or less than are based on--- ASCII character code values. For example, 'a' is greater than 'A', and 'aa' is+-- ASCII character code values. For example, 'a' is greater than 'A', and 'a' is -- greater than 'B'. For a list of code values, see <http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters>. -- -- For Binary, DynamoDB treats each byte of the binary data as unsigned when it@@ -1330,9 +1366,19 @@ -- 'NOT_NULL' : The attribute exists. 'NOT_NULL' is supported for all datatypes, -- including lists and maps. --+-- This operator tests for the existence of an attribute, not its data type. If+-- the data type of attribute "'a'" is null, and you evaluate it using 'NOT_NULL',+-- the result is a Boolean /true/. This result is because the attribute "'a'"+-- exists; its data type is not relevant to the 'NOT_NULL' comparison operator.+-- -- 'NULL' : The attribute does not exist. 'NULL' is supported for all datatypes, -- including lists and maps. --+-- This operator tests for the nonexistence of an attribute, not its data type.+-- If the data type of attribute "'a'" is null, and you evaluate it using 'NULL',+-- the result is a Boolean /false/. This is because the attribute "'a'" exists; its+-- data type is not relevant to the 'NULL' comparison operator.+-- -- 'CONTAINS' : Checks for a subsequence, or value in a set. -- -- /AttributeValueList/ can contain only one /AttributeValue/ element of type@@ -1629,7 +1675,8 @@ ] data GlobalSecondaryIndexDescription = GlobalSecondaryIndexDescription- { _gsidIndexName :: Maybe Text+ { _gsidBackfilling :: Maybe Bool+ , _gsidIndexName :: Maybe Text , _gsidIndexSizeBytes :: Maybe Integer , _gsidIndexStatus :: Maybe IndexStatus , _gsidItemCount :: Maybe Integer@@ -1642,6 +1689,8 @@ -- -- The fields accessible through corresponding lenses are: --+-- * 'gsidBackfilling' @::@ 'Maybe' 'Bool'+-- -- * 'gsidIndexName' @::@ 'Maybe' 'Text' -- -- * 'gsidIndexSizeBytes' @::@ 'Maybe' 'Integer'@@ -1663,11 +1712,25 @@ , _gsidIndexName = Nothing , _gsidProjection = Nothing , _gsidIndexStatus = Nothing+ , _gsidBackfilling = Nothing , _gsidProvisionedThroughput = Nothing , _gsidIndexSizeBytes = Nothing , _gsidItemCount = Nothing } +-- | Indicates whether the index is currently backfilling. /Backfilling/ is the+-- process of reading items from the table and determining whether they can be+-- added to the index. (Not all items will qualify: For example, a hash key+-- attribute cannot have any duplicates.) If an item can be added to the index,+-- DynamoDB will do so. After all items have been processed, the backfilling+-- operation is complete and /Backfilling/ is false.+--+-- For indexes that were created during a /CreateTable/ operation, the /Backfilling/+-- attribute does not appear in the /DescribeTable/ output.+--+gsidBackfilling :: Lens' GlobalSecondaryIndexDescription (Maybe Bool)+gsidBackfilling = lens _gsidBackfilling (\s a -> s { _gsidBackfilling = a })+ -- | The name of the global secondary index. gsidIndexName :: Lens' GlobalSecondaryIndexDescription (Maybe Text) gsidIndexName = lens _gsidIndexName (\s a -> s { _gsidIndexName = a })@@ -1685,8 +1748,7 @@ -- -- /UPDATING/ - The index is being updated, as the result of a /CreateTable/ or /UpdateTable/ operation. ----- /DELETING/ - The index is being deleted, as the result of a /DeleteTable/--- operation.+-- /DELETING/ - The index is being deleted, as the result of an /UpdateTable/ or /DeleteTable/ operation. -- -- /ACTIVE/ - The index is ready for use. --@@ -1715,7 +1777,8 @@ instance FromJSON GlobalSecondaryIndexDescription where parseJSON = withObject "GlobalSecondaryIndexDescription" $ \o -> GlobalSecondaryIndexDescription- <$> o .:? "IndexName"+ <$> o .:? "Backfilling"+ <*> o .:? "IndexName" <*> o .:? "IndexSizeBytes" <*> o .:? "IndexStatus" <*> o .:? "ItemCount"@@ -1729,6 +1792,7 @@ , "KeySchema" .= _gsidKeySchema , "Projection" .= _gsidProjection , "IndexStatus" .= _gsidIndexStatus+ , "Backfilling" .= _gsidBackfilling , "ProvisionedThroughput" .= _gsidProvisionedThroughput , "IndexSizeBytes" .= _gsidIndexSizeBytes , "ItemCount" .= _gsidItemCount@@ -2145,6 +2209,68 @@ , "NonKeyAttributes" .= _pNonKeyAttributes ] +data CreateGlobalSecondaryIndexAction = CreateGlobalSecondaryIndexAction+ { _cgsiaIndexName :: Text+ , _cgsiaKeySchema :: List1 "KeySchema" KeySchemaElement+ , _cgsiaProjection :: Projection+ , _cgsiaProvisionedThroughput :: ProvisionedThroughput+ } deriving (Eq, Read, Show)++-- | 'CreateGlobalSecondaryIndexAction' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'cgsiaIndexName' @::@ 'Text'+--+-- * 'cgsiaKeySchema' @::@ 'NonEmpty' 'KeySchemaElement'+--+-- * 'cgsiaProjection' @::@ 'Projection'+--+-- * 'cgsiaProvisionedThroughput' @::@ 'ProvisionedThroughput'+--+createGlobalSecondaryIndexAction :: Text -- ^ 'cgsiaIndexName'+ -> NonEmpty KeySchemaElement -- ^ 'cgsiaKeySchema'+ -> Projection -- ^ 'cgsiaProjection'+ -> ProvisionedThroughput -- ^ 'cgsiaProvisionedThroughput'+ -> CreateGlobalSecondaryIndexAction+createGlobalSecondaryIndexAction p1 p2 p3 p4 = CreateGlobalSecondaryIndexAction+ { _cgsiaIndexName = p1+ , _cgsiaKeySchema = withIso _List1 (const id) p2+ , _cgsiaProjection = p3+ , _cgsiaProvisionedThroughput = p4+ }++-- | The name of the global secondary index to be created.+cgsiaIndexName :: Lens' CreateGlobalSecondaryIndexAction Text+cgsiaIndexName = lens _cgsiaIndexName (\s a -> s { _cgsiaIndexName = a })++-- | The key schema for the global secondary index.+cgsiaKeySchema :: Lens' CreateGlobalSecondaryIndexAction (NonEmpty KeySchemaElement)+cgsiaKeySchema = lens _cgsiaKeySchema (\s a -> s { _cgsiaKeySchema = a }) . _List1++cgsiaProjection :: Lens' CreateGlobalSecondaryIndexAction Projection+cgsiaProjection = lens _cgsiaProjection (\s a -> s { _cgsiaProjection = a })++cgsiaProvisionedThroughput :: Lens' CreateGlobalSecondaryIndexAction ProvisionedThroughput+cgsiaProvisionedThroughput =+ lens _cgsiaProvisionedThroughput+ (\s a -> s { _cgsiaProvisionedThroughput = a })++instance FromJSON CreateGlobalSecondaryIndexAction where+ parseJSON = withObject "CreateGlobalSecondaryIndexAction" $ \o -> CreateGlobalSecondaryIndexAction+ <$> o .: "IndexName"+ <*> o .: "KeySchema"+ <*> o .: "Projection"+ <*> o .: "ProvisionedThroughput"++instance ToJSON CreateGlobalSecondaryIndexAction where+ toJSON CreateGlobalSecondaryIndexAction{..} = object+ [ "IndexName" .= _cgsiaIndexName+ , "KeySchema" .= _cgsiaKeySchema+ , "Projection" .= _cgsiaProjection+ , "ProvisionedThroughput" .= _cgsiaProvisionedThroughput+ ]+ data Select = AllAttributes -- ^ ALL_ATTRIBUTES | AllProjectedAttributes -- ^ ALL_PROJECTED_ATTRIBUTES@@ -2221,6 +2347,35 @@ , "KeyType" .= _kseKeyType ] +newtype DeleteGlobalSecondaryIndexAction = DeleteGlobalSecondaryIndexAction+ { _dgsiaIndexName :: Text+ } deriving (Eq, Ord, Read, Show, Monoid, IsString)++-- | 'DeleteGlobalSecondaryIndexAction' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'dgsiaIndexName' @::@ 'Text'+--+deleteGlobalSecondaryIndexAction :: Text -- ^ 'dgsiaIndexName'+ -> DeleteGlobalSecondaryIndexAction+deleteGlobalSecondaryIndexAction p1 = DeleteGlobalSecondaryIndexAction+ { _dgsiaIndexName = p1+ }++-- | The name of the global secondary index to be deleted.+dgsiaIndexName :: Lens' DeleteGlobalSecondaryIndexAction Text+dgsiaIndexName = lens _dgsiaIndexName (\s a -> s { _dgsiaIndexName = a })++instance FromJSON DeleteGlobalSecondaryIndexAction where+ parseJSON = withObject "DeleteGlobalSecondaryIndexAction" $ \o -> DeleteGlobalSecondaryIndexAction+ <$> o .: "IndexName"++instance ToJSON DeleteGlobalSecondaryIndexAction where+ toJSON DeleteGlobalSecondaryIndexAction{..} = object+ [ "IndexName" .= _dgsiaIndexName+ ]+ newtype DeleteRequest = DeleteRequest { _dKey :: Map Text AttributeValue } deriving (Eq, Read, Show, Monoid, Semigroup)@@ -2350,7 +2505,7 @@ -- For type Number, value comparisons are numeric. -- -- String value comparisons for greater than, equals, or less than are based on--- ASCII character code values. For example, 'a' is greater than 'A', and 'aa' is+-- ASCII character code values. For example, 'a' is greater than 'A', and 'a' is -- greater than 'B'. For a list of code values, see <http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters>. -- -- For Binary, DynamoDB treats each byte of the binary data as unsigned when it@@ -2424,9 +2579,19 @@ -- 'NOT_NULL' : The attribute exists. 'NOT_NULL' is supported for all datatypes, -- including lists and maps. --+-- This operator tests for the existence of an attribute, not its data type. If+-- the data type of attribute "'a'" is null, and you evaluate it using 'NOT_NULL',+-- the result is a Boolean /true/. This result is because the attribute "'a'"+-- exists; its data type is not relevant to the 'NOT_NULL' comparison operator.+-- -- 'NULL' : The attribute does not exist. 'NULL' is supported for all datatypes, -- including lists and maps. --+-- This operator tests for the nonexistence of an attribute, not its data type.+-- If the data type of attribute "'a'" is null, and you evaluate it using 'NULL',+-- the result is a Boolean /false/. This is because the attribute "'a'" exists; its+-- data type is not relevant to the 'NULL' comparison operator.+-- -- 'CONTAINS' : Checks for a subsequence, or value in a set. -- -- /AttributeValueList/ can contain only one /AttributeValue/ element of type@@ -2524,31 +2689,64 @@ instance ToJSON ConditionalOperator where toJSON = toJSONText -newtype GlobalSecondaryIndexUpdate = GlobalSecondaryIndexUpdate- { _gsiuUpdate :: Maybe UpdateGlobalSecondaryIndexAction+data GlobalSecondaryIndexUpdate = GlobalSecondaryIndexUpdate+ { _gsiuCreate :: Maybe CreateGlobalSecondaryIndexAction+ , _gsiuDelete :: Maybe DeleteGlobalSecondaryIndexAction+ , _gsiuUpdate :: Maybe UpdateGlobalSecondaryIndexAction } deriving (Eq, Read, Show) -- | 'GlobalSecondaryIndexUpdate' constructor. -- -- The fields accessible through corresponding lenses are: --+-- * 'gsiuCreate' @::@ 'Maybe' 'CreateGlobalSecondaryIndexAction'+--+-- * 'gsiuDelete' @::@ 'Maybe' 'DeleteGlobalSecondaryIndexAction'+-- -- * 'gsiuUpdate' @::@ 'Maybe' 'UpdateGlobalSecondaryIndexAction' -- globalSecondaryIndexUpdate :: GlobalSecondaryIndexUpdate globalSecondaryIndexUpdate = GlobalSecondaryIndexUpdate { _gsiuUpdate = Nothing+ , _gsiuCreate = Nothing+ , _gsiuDelete = Nothing } --- | The name of a global secondary index, along with the updated provisioned--- throughput settings that are to be applied to that index.+-- | The parameters required for creating a global secondary index on an existing+-- table:+--+-- 'IndexName '+--+-- 'KeySchema '+--+-- 'AttributeDefinitions '+--+-- 'Projection '+--+-- 'ProvisionedThroughput '+--+--+gsiuCreate :: Lens' GlobalSecondaryIndexUpdate (Maybe CreateGlobalSecondaryIndexAction)+gsiuCreate = lens _gsiuCreate (\s a -> s { _gsiuCreate = a })++-- | The name of an existing global secondary index to be removed.+gsiuDelete :: Lens' GlobalSecondaryIndexUpdate (Maybe DeleteGlobalSecondaryIndexAction)+gsiuDelete = lens _gsiuDelete (\s a -> s { _gsiuDelete = a })++-- | The name of an existing global secondary index, along with new provisioned+-- throughput settings to be applied to that index. gsiuUpdate :: Lens' GlobalSecondaryIndexUpdate (Maybe UpdateGlobalSecondaryIndexAction) gsiuUpdate = lens _gsiuUpdate (\s a -> s { _gsiuUpdate = a }) instance FromJSON GlobalSecondaryIndexUpdate where parseJSON = withObject "GlobalSecondaryIndexUpdate" $ \o -> GlobalSecondaryIndexUpdate- <$> o .:? "Update"+ <$> o .:? "Create"+ <*> o .:? "Delete"+ <*> o .:? "Update" instance ToJSON GlobalSecondaryIndexUpdate where toJSON GlobalSecondaryIndexUpdate{..} = object [ "Update" .= _gsiuUpdate+ , "Create" .= _gsiuCreate+ , "Delete" .= _gsiuDelete ]
gen/Network/AWS/DynamoDB/UpdateItem.hs view
@@ -173,6 +173,16 @@ -- If the existing attribute is a number, and if /Value/ is also a number, then /Value/ is mathematically added to the existing attribute. If /Value/ is a -- negative number, then it is subtracted from the existing attribute. --+-- If you use 'ADD' to increment or decrement a number value for an item that+-- doesn't exist before the update, DynamoDB uses 0 as the initial value.+--+-- Similarly, if you use 'ADD' for an existing item to increment or decrement an+-- attribute value that doesn't exist before the update, DynamoDB uses '0' as the+-- initial value. For example, suppose that the item you want to update doesn't+-- have an attribute named /itemcount/, but you decide to 'ADD' the number '3' to this+-- attribute anyway. DynamoDB will create the /itemcount/ attribute, set its+-- initial value to '0', and finally add '3' to it. The result will be a new /itemcount/ attribute, with a value of '3'.+-- -- If the existing data type is a set, and if /Value/ is also a set, then /Value/ -- is appended to the existing set. For example, if the attribute value is the -- set '[1,2]', and the 'ADD' action specified '[3]', then the final attribute value@@ -188,9 +198,11 @@ -- 'PUT' - Causes DynamoDB to create a new item with the specified primary key, -- and then adds the attribute. ----- 'DELETE' - Causes nothing to happen; there is no attribute to delete.+-- 'DELETE' - Nothing happens, because attributes cannot be deleted from a+-- nonexistent item. The operation succeeds, but DynamoDB does not create a new+-- item. ----- 'ADD' - Causes DynamoDB to creat an item with the supplied primary key and+-- 'ADD' - Causes DynamoDB to create an item with the supplied primary key and -- number (or set of numbers) for the attribute value. The only data types -- allowed are Number and Number Set. --@@ -207,13 +219,16 @@ -- -- An expression can contain any of the following: ----- Boolean functions: 'ATTRIBUTE_EXIST | CONTAINS | BEGINS_WITH'+-- Boolean functions: 'attribute_exists | attribute_not_exists | contains |begins_with' ----- Comparison operators: ' = | <> | < | > | <= | >= | BETWEEN | IN'+-- These function names are case-sensitive. ----- Logical operators: 'NOT | AND | OR'+-- Comparison operators: ' = | <> | < | > | <= | >= | BETWEEN | IN' --+-- Logical operators: 'AND | OR | NOT' --+-- For more information on condition expressions, go to <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html Specifying Conditions>+-- in the /Amazon DynamoDB Developer Guide/. uiConditionExpression :: Lens' UpdateItem (Maybe Text) uiConditionExpression = lens _uiConditionExpression (\s a -> s { _uiConditionExpression = a })@@ -271,7 +286,7 @@ -- For type Number, value comparisons are numeric. -- -- String value comparisons for greater than, equals, or less than are based on--- ASCII character code values. For example, 'a' is greater than 'A', and 'aa' is+-- ASCII character code values. For example, 'a' is greater than 'A', and 'a' is -- greater than 'B'. For a list of code values, see <http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters>. -- -- For type Binary, DynamoDB treats each byte of the binary data as unsigned@@ -340,9 +355,19 @@ -- 'NOT_NULL' : The attribute exists. 'NOT_NULL' is supported for all datatypes, -- including lists and maps. --+-- This operator tests for the existence of an attribute, not its data type. If+-- the data type of attribute "'a'" is null, and you evaluate it using 'NOT_NULL',+-- the result is a Boolean /true/. This result is because the attribute "'a'"+-- exists; its data type is not relevant to the 'NOT_NULL' comparison operator.+-- -- 'NULL' : The attribute does not exist. 'NULL' is supported for all datatypes, -- including lists and maps. --+-- This operator tests for the nonexistence of an attribute, not its data type.+-- If the data type of attribute "'a'" is null, and you evaluate it using 'NULL',+-- the result is a Boolean /false/. This is because the attribute "'a'" exists; its+-- data type is not relevant to the 'NULL' comparison operator.+-- -- 'CONTAINS' : Checks for a subsequence, or value in a set. -- -- /AttributeValueList/ can contain only one /AttributeValue/ element of type@@ -414,6 +439,8 @@ -- is valid and the condition evaluates to true. If the value is found, despite -- the assumption that it does not exist, the condition evaluates to false. --+-- Note that the default value for /Exists/ is 'true'.+-- -- The /Value/ and /Exists/ parameters are incompatible with /AttributeValueList/ -- and /ComparisonOperator/. Note that if you use both sets of parameters at once, -- DynamoDB will return a /ValidationException/ exception.@@ -421,7 +448,7 @@ uiExpected = lens _uiExpected (\s a -> s { _uiExpected = a }) . _Map -- | One or more substitution tokens for simplifying complex expressions. The--- following are some use cases for an /ExpressionAttributeNames/ value:+-- following are some use cases for using /ExpressionAttributeNames/: -- -- To shorten an attribute name that is very long or unwieldy in an -- expression.@@ -439,12 +466,13 @@ -- -- Now suppose that you specified the following for /ExpressionAttributeNames/: ----- '{"n":"order.customerInfo.LastName"}'+-- '{"#name":"order.customerInfo.LastName"}' -- -- The expression can now be simplified as follows: ----- '#n = "Smith" OR #n = "Jones"'+-- '#name = "Smith" OR #name = "Jones"' --+-- For more information on expression attribute names, go to <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html Accessing ItemAttributes> in the /Amazon DynamoDB Developer Guide/. uiExpressionAttributeNames :: Lens' UpdateItem (HashMap Text Text) uiExpressionAttributeNames = lens _uiExpressionAttributeNames@@ -453,19 +481,20 @@ -- | One or more values that can be substituted in an expression. ----- Use the : character in an expression to dereference an attribute value. For--- example, consider the following expression:+-- Use the : (colon) character in an expression to dereference an attribute+-- value. For example, suppose that you wanted to check whether the value of the /ProductStatus/ attribute was one of the following: ----- 'ProductStatus IN ("Available","Backordered","Discontinued")'+-- 'Available | Backordered | Discontinued' ----- Now suppose that you specified the following for /ExpressionAttributeValues/:+-- You would first need to specify /ExpressionAttributeValues/ as follows: ----- '{ "a":{"S":"Available"}, "b":{"S":"Backordered"}, "d":{"S":"Discontinued"} }'+-- '{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"},":disc":{"S":"Discontinued"} }' ----- The expression can now be simplified as follows:+-- You could then use these values in an expression, such as this: ----- 'ProductStatus IN (:a,:b,:c)'+-- 'ProductStatus IN (:avail, :back, :disc)' --+-- For more information on expression attribute values, go to <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html SpecifyingConditions> in the /Amazon DynamoDB Developer Guide/. uiExpressionAttributeValues :: Lens' UpdateItem (HashMap Text AttributeValue) uiExpressionAttributeValues = lens _uiExpressionAttributeValues@@ -551,6 +580,16 @@ -- If the existing attribute is a number, and if /Value/ is also a number, then /Value/ is mathematically added to the existing attribute. If /Value/ is a -- negative number, then it is subtracted from the existing attribute. --+-- If you use 'ADD' to increment or decrement a number value for an item that+-- doesn't exist before the update, DynamoDB uses '0' as the initial value.+--+-- Similarly, if you use 'ADD' for an existing item to increment or decrement an+-- attribute value that doesn't exist before the update, DynamoDB uses '0' as the+-- initial value. For example, suppose that the item you want to update doesn't+-- have an attribute named /itemcount/, but you decide to 'ADD' the number '3' to this+-- attribute anyway. DynamoDB will create the /itemcount/ attribute, set its+-- initial value to '0', and finally add '3' to it. The result will be a new /itemcount/ attribute in the item, with a value of '3'.+-- -- If the existing data type is a set and if /Value/ is also a set, then /Value/ -- is added to the existing set. For example, if the attribute value is the set '[1,2]', and the 'ADD' action specified '[3]', then the final attribute value is '[1,2,3]'. An error occurs if an -- 'ADD' action is specified for a set attribute and the attribute type specified@@ -573,15 +612,7 @@ -- -- You can have many actions in a single expression, such as the following: 'SET a=:value1, b=:value2 DELETE :value3, :value4, :value5' ----- An expression can contain any of the following:------ Boolean functions: 'ATTRIBUTE_EXIST | CONTAINS | BEGINS_WITH'------ Comparison operators: ' = | <> | < | > | <= | >= | BETWEEN | IN'------ Logical operators: 'NOT | AND | OR'------+-- For more information on update expressions, go to <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.Modifying.html Modifying Items andAttributes> in the /Amazon DynamoDB Developer Guide/. uiUpdateExpression :: Lens' UpdateItem (Maybe Text) uiUpdateExpression = lens _uiUpdateExpression (\s a -> s { _uiUpdateExpression = a })
gen/Network/AWS/DynamoDB/UpdateTable.hs view
@@ -22,21 +22,20 @@ -- -- Derived from AWS service descriptions, licensed under Apache 2.0. --- | Updates the provisioned throughput for the given table. Setting the--- throughput for a table helps you manage performance and is part of the--- provisioned throughput feature of DynamoDB.+-- | Updates the provisioned throughput for the given table, or manages the global+-- secondary indexes on the table. ----- The provisioned throughput values can be upgraded or downgraded based on the--- maximums and minimums listed in the <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html Limits> section in the /Amazon DynamoDBDeveloper Guide/.+-- You can increase or decrease the table's provisioned throughput values+-- within the maximums and minimums listed in the <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html Limits> section in the /AmazonDynamoDB Developer Guide/. ----- The table must be in the 'ACTIVE' state for this operation to succeed. /UpdateTable/ is an asynchronous operation; while executing the operation, the table is in--- the 'UPDATING' state. While the table is in the 'UPDATING' state, the table still--- has the provisioned throughput from before the call. The new provisioned--- throughput setting is in effect only when the table returns to the 'ACTIVE'--- state after the /UpdateTable/ operation.+-- In addition, you can use /UpdateTable/ to add, modify or delete global+-- secondary indexes on the table. For more information, see <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.OnlineOps.html Managing GlobalSecondary Indexes> in the /Amazon DynamoDB Developer Guide/. ----- You cannot add, modify or delete indexes using /UpdateTable/. Indexes can only--- be defined at table creation time.+-- The table must be in the 'ACTIVE' state for /UpdateTable/ to succeed. /UpdateTable/+-- is an asynchronous operation; while executing the operation, the table is in+-- the 'UPDATING' state. While the table is in the 'UPDATING' state, the table still+-- has the provisioned throughput from before the call. The table's new+-- provisioned throughput settings go into effect when the table returns to the 'ACTIVE' state; at that point, the /UpdateTable/ operation is complete. -- -- <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateTable.html> module Network.AWS.DynamoDB.UpdateTable@@ -46,6 +45,7 @@ -- ** Request constructor , updateTable -- ** Request lenses+ , utAttributeDefinitions , utGlobalSecondaryIndexUpdates , utProvisionedThroughput , utTableName@@ -64,7 +64,8 @@ import qualified GHC.Exts data UpdateTable = UpdateTable- { _utGlobalSecondaryIndexUpdates :: List "GlobalSecondaryIndexUpdates" GlobalSecondaryIndexUpdate+ { _utAttributeDefinitions :: List "AttributeDefinitions" AttributeDefinition+ , _utGlobalSecondaryIndexUpdates :: List "GlobalSecondaryIndexUpdates" GlobalSecondaryIndexUpdate , _utProvisionedThroughput :: Maybe ProvisionedThroughput , _utTableName :: Text } deriving (Eq, Read, Show)@@ -73,6 +74,8 @@ -- -- The fields accessible through corresponding lenses are: --+-- * 'utAttributeDefinitions' @::@ ['AttributeDefinition']+-- -- * 'utGlobalSecondaryIndexUpdates' @::@ ['GlobalSecondaryIndexUpdate'] -- -- * 'utProvisionedThroughput' @::@ 'Maybe' 'ProvisionedThroughput'@@ -83,12 +86,29 @@ -> UpdateTable updateTable p1 = UpdateTable { _utTableName = p1+ , _utAttributeDefinitions = mempty , _utProvisionedThroughput = Nothing , _utGlobalSecondaryIndexUpdates = mempty } --- | An array of one or more global secondary indexes on the table, together with--- provisioned throughput settings for each index.+-- | An array of attributes that describe the key schema for the table and+-- indexes. If you are adding a new global secondary index to the table, /AttributeDefinitions/ must include the key element(s) of the new index.+utAttributeDefinitions :: Lens' UpdateTable [AttributeDefinition]+utAttributeDefinitions =+ lens _utAttributeDefinitions (\s a -> s { _utAttributeDefinitions = a })+ . _List++-- | An array of one or more global secondary indexes for the table. For each+-- index in the array, you can specify one action:+--+-- /Create/ - add a new global secondary index to the table.+--+-- /Update/ - modify the provisioned throughput settings of an existing global+-- secondary index.+--+-- /Delete/ - remove a global secondary index from the table.+--+-- utGlobalSecondaryIndexUpdates :: Lens' UpdateTable [GlobalSecondaryIndexUpdate] utGlobalSecondaryIndexUpdates = lens _utGlobalSecondaryIndexUpdates@@ -132,7 +152,8 @@ instance ToJSON UpdateTable where toJSON UpdateTable{..} = object- [ "TableName" .= _utTableName+ [ "AttributeDefinitions" .= _utAttributeDefinitions+ , "TableName" .= _utTableName , "ProvisionedThroughput" .= _utProvisionedThroughput , "GlobalSecondaryIndexUpdates" .= _utGlobalSecondaryIndexUpdates ]