amazonka-dynamodb 0.0.1 → 0.0.2
raw patch · 16 files changed
+4239/−3366 lines, 16 filesdep ~amazonka-corePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: amazonka-core
API changes (from Hackage documentation)
Files
- README.md +7/−1
- amazonka-dynamodb.cabal +9/−10
- gen/Network/AWS/DynamoDB.hs +7/−8
- gen/Network/AWS/DynamoDB/BatchGetItem.hs +96/−68
- gen/Network/AWS/DynamoDB/BatchWriteItem.hs +150/−109
- gen/Network/AWS/DynamoDB/CreateTable.hs +99/−65
- gen/Network/AWS/DynamoDB/DeleteItem.hs +299/−193
- gen/Network/AWS/DynamoDB/DeleteTable.hs +7/−9
- gen/Network/AWS/DynamoDB/GetItem.hs +59/−40
- gen/Network/AWS/DynamoDB/ListTables.hs +17/−15
- gen/Network/AWS/DynamoDB/PutItem.hs +318/−206
- gen/Network/AWS/DynamoDB/Query.hs +335/−232
- gen/Network/AWS/DynamoDB/Scan.hs +212/−143
- gen/Network/AWS/DynamoDB/Types.hs +2197/−1984
- gen/Network/AWS/DynamoDB/UpdateItem.hs +412/−270
- gen/Network/AWS/DynamoDB/UpdateTable.hs +15/−13
README.md view
@@ -8,7 +8,13 @@ ## Description -Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability. You can use Amazon DynamoDB to create a database table that can store and retrieve any amount of data, and serve any level of request traffic. Amazon DynamoDB automatically spreads the data and traffic for the table over a sufficient number of servers to handle the request capacity specified by the customer and the amount of data stored, while maintaining consistent and fast performance.+ Amazon DynamoDB is a fully managed NoSQL database service that provides fast+ and predictable performance with seamless scalability. You can use Amazon+ DynamoDB to create a database table that can store and retrieve any amount of+ data, and serve any level of request traffic. Amazon DynamoDB automatically+ spreads the data and traffic for the table over a sufficient number of+ servers to handle the request capacity specified by the customer and the+ amount of data stored, while maintaining consistent and fast performance. Documentation is available via [Hackage](http://hackage.haskell.org/package/amazonka-dynamodb) and [AWS API Reference](http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/Welcome.html).
amazonka-dynamodb.cabal view
@@ -1,5 +1,5 @@ name: amazonka-dynamodb-version: 0.0.1+version: 0.0.2 synopsis: Amazon DynamoDB SDK. homepage: https://github.com/brendanhay/amazonka license: OtherLicense@@ -13,14 +13,13 @@ cabal-version: >= 1.10 description:- Amazon DynamoDB is a fully managed NoSQL database service that provides- fast and predictable performance with seamless scalability. You can use- Amazon DynamoDB to create a database table that can store and retrieve- any amount of data, and serve any level of request traffic. Amazon- DynamoDB automatically spreads the data and traffic for the table over- a sufficient number of servers to handle the request capacity specified- by the customer and the amount of data stored, while maintaining- consistent and fast performance.+ Amazon DynamoDB is a fully managed NoSQL database service that provides fast+ and predictable performance with seamless scalability. You can use Amazon+ DynamoDB to create a database table that can store and retrieve any amount of+ data, and serve any level of request traffic. Amazon DynamoDB automatically+ spreads the data and traffic for the table over a sufficient number of+ servers to handle the request capacity specified by the customer and the+ amount of data stored, while maintaining consistent and fast performance. . /See:/ <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/Welcome.html AWS API Reference> .@@ -57,5 +56,5 @@ other-modules: build-depends:- amazonka-core == 0.0.1.*+ amazonka-core == 0.0.2.* , base >= 4.7 && < 5
gen/Network/AWS/DynamoDB.hs view
@@ -8,14 +8,13 @@ -- Stability : experimental -- Portability : non-portable (GHC extensions) --- | Amazon DynamoDB is a fully managed NoSQL database service that provides--- fast and predictable performance with seamless scalability. You can use--- Amazon DynamoDB to create a database table that can store and retrieve any--- amount of data, and serve any level of request traffic. Amazon DynamoDB--- automatically spreads the data and traffic for the table over a sufficient--- number of servers to handle the request capacity specified by the customer--- and the amount of data stored, while maintaining consistent and fast--- performance.+-- | Amazon DynamoDB is a fully managed NoSQL database service that provides fast+-- and predictable performance with seamless scalability. You can use Amazon+-- DynamoDB to create a database table that can store and retrieve any amount of+-- data, and serve any level of request traffic. Amazon DynamoDB automatically+-- spreads the data and traffic for the table over a sufficient number of+-- servers to handle the request capacity specified by the customer and the+-- amount of data stored, while maintaining consistent and fast performance. module Network.AWS.DynamoDB ( module Network.AWS.DynamoDB.BatchGetItem , module Network.AWS.DynamoDB.BatchWriteItem
gen/Network/AWS/DynamoDB/BatchGetItem.hs view
@@ -20,44 +20,51 @@ -- Stability : experimental -- Portability : non-portable (GHC extensions) --- | The BatchGetItem operation returns the attributes of one or more items from--- one or more tables. You identify requested items by primary key. A single--- operation can retrieve up to 16 MB of data, which can contain as many as--- 100 items. BatchGetItem will return a partial result if the response size--- limit is exceeded, the table's provisioned throughput is exceeded, or an+-- | The /BatchGetItem/ operation returns the attributes of one or more items from+-- one or more tables. You identify requested items by primary key.+--+-- A single operation can retrieve up to 16 MB of data, which can contain as+-- many as 100 items. /BatchGetItem/ will return a partial result if the response+-- size limit is exceeded, the table's provisioned throughput is exceeded, or an -- internal processing failure occurs. If a partial result is returned, the--- operation returns a value for UnprocessedKeys. You can use this value to--- retry the operation starting with the next item to get. For example, if you--- ask to retrieve 100 items, but each individual item is 300 KB in size, the--- system returns 52 items (so as not to exceed the 16 MB limit). It also--- returns an appropriate UnprocessedKeys value so you can get the next page--- of results. If desired, your application can include its own logic to--- assemble the pages of results into one data set. If none of the items can--- be processed due to insufficient provisioned throughput on all of the--- tables in the request, then BatchGetItem will return a--- ProvisionedThroughputExceededException. If at least one of the items is--- successfully processed, then BatchGetItem completes successfully, while--- returning the keys of the unread items in UnprocessedKeys. If DynamoDB--- returns any unprocessed items, you should retry the batch operation on--- those items. However, we strongly recommend that you use an exponential--- backoff algorithm. If you retry the batch operation immediately, the--- underlying read or write requests can still fail due to throttling on the+-- operation returns a value for /UnprocessedKeys/. You can use this value to+-- retry the operation starting with the next item to get.+--+-- For example, if you ask to retrieve 100 items, but each individual item is+-- 300 KB in size, the system returns 52 items (so as not to exceed the 16 MB+-- limit). It also returns an appropriate /UnprocessedKeys/ value so you can get+-- the next page of results. If desired, your application can include its own+-- logic to assemble the pages of results into one data set.+--+-- If /none/ of the items can be processed due to insufficient provisioned+-- throughput on all of the tables in the request, then /BatchGetItem/ will return+-- a /ProvisionedThroughputExceededException/. If /at least one/ of the items is+-- successfully processed, then /BatchGetItem/ completes successfully, while+-- returning the keys of the unread items in /UnprocessedKeys/.+--+-- If DynamoDB returns any unprocessed items, you should retry the batch+-- operation on those items. However, /we strongly recommend that you use anexponential backoff algorithm/. If you retry the batch operation immediately,+-- the underlying read or write requests can still fail due to throttling on the -- individual tables. If you delay the batch operation using exponential--- backoff, the individual requests in the batch are much more likely to--- succeed. For more information, go to Batch Operations and Error Handling in--- the Amazon DynamoDB Developer Guide. By default, BatchGetItem performs--- eventually consistent reads on every table in the request. If you want--- strongly consistent reads instead, you can set ConsistentRead to true for--- any or all tables. In order to minimize response latency, BatchGetItem--- retrieves items in parallel. When designing your application, keep in mind--- that DynamoDB does not return attributes in any particular order. To help--- parse the response by item, include the primary key values for the items in--- your request in the AttributesToGet parameter. If a requested item does not--- exist, it is not returned in the result. Requests for nonexistent items--- consume the minimum read capacity units according to the type of read. For--- more information, see Capacity Units Calculations in the Amazon DynamoDB--- Developer Guide.+-- backoff, the individual requests in the batch are much more likely to succeed. --+-- For more information, go to <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#BatchOperations Batch Operations and Error Handling> in the /Amazon DynamoDB Developer Guide/.+--+-- By default, /BatchGetItem/ performs eventually consistent reads on every+-- table in the request. If you want strongly consistent reads instead, you can+-- set /ConsistentRead/ to 'true' for any or all tables.+--+-- In order to minimize response latency, /BatchGetItem/ retrieves items in+-- parallel.+--+-- When designing your application, keep in mind that DynamoDB does not return+-- attributes in any particular order. To help parse the response by item,+-- include the primary key values for the items in your request in the /AttributesToGet/ parameter.+--+-- If a requested item does not exist, it is not returned in the result.+-- Requests for nonexistent items consume the minimum read capacity units+-- according to the type of read. For more information, see <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#CapacityUnitCalculations Capacity UnitsCalculations> in the /Amazon DynamoDB Developer Guide/.+-- -- <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_BatchGetItem.html> module Network.AWS.DynamoDB.BatchGetItem (@@ -104,20 +111,29 @@ } -- | A map of one or more table names and, for each table, the corresponding--- primary keys for the items to retrieve. Each table name can be invoked--- only once. Each element in the map consists of the following: Keys - An--- array of primary key attribute values that define specific items in the--- table. For each primary key, you must provide all of the key attributes.--- For example, with a hash type primary key, you only need to specify the--- hash attribute. For a hash-and-range type primary key, you must specify--- both the hash attribute and the range attribute. AttributesToGet - One or--- more attributes to be retrieved from the table. By default, all--- attributes are returned. If a specified attribute is not found, it does--- not appear in the result. Note that AttributesToGet has no effect on--- provisioned throughput consumption. DynamoDB determines capacity units--- consumed based on item size, not on the amount of data that is returned--- to an application. ConsistentRead - If true, a strongly consistent read--- is used; if false (the default), an eventually consistent read is used.+-- primary keys for the items to retrieve. Each table name can be invoked only+-- once.+--+-- Each element in the map consists of the following:+--+-- /Keys/ - An array of primary key attribute values that define specific items+-- in the table. For each primary key, you must provide /all/ of the key+-- attributes. For example, with a hash type primary key, you only need to+-- specify the hash attribute. For a hash-and-range type primary key, you must+-- specify /both/ the hash attribute and the range attribute.+--+-- /AttributesToGet/ - One or more attributes to be retrieved from the table.+-- By default, all attributes are returned. If a specified attribute is not+-- found, it does not appear in the result.+--+-- Note that /AttributesToGet/ has no effect on provisioned throughput+-- consumption. DynamoDB determines capacity units consumed based on item size,+-- not on the amount of data that is returned to an application.+--+-- /ConsistentRead/ - If 'true', a strongly consistent read is used; if 'false'+-- (the default), an eventually consistent read is used.+--+-- bgiRequestItems :: Lens' BatchGetItem (HashMap Text KeysAndAttributes) bgiRequestItems = lens _bgiRequestItems (\s a -> s { _bgiRequestItems = a }) . _Map @@ -149,33 +165,45 @@ , _bgirConsumedCapacity = mempty } --- | The write capacity units consumed by the operation. Each element consists--- of: TableName - The table that consumed the provisioned throughput.--- CapacityUnits - The total number of capacity units consumed.+-- | The write capacity units consumed by the operation.+--+-- Each element consists of:+--+-- /TableName/ - The table that consumed the provisioned throughput.+--+-- /CapacityUnits/ - The total number of capacity units consumed.+--+-- bgirConsumedCapacity :: Lens' BatchGetItemResponse [ConsumedCapacity] bgirConsumedCapacity = lens _bgirConsumedCapacity (\s a -> s { _bgirConsumedCapacity = a }) . _List --- | A map of table name to a list of items. Each object in Responses consists--- of a table name, along with a map of attribute data consisting of the--- data type and attribute value.+-- | A map of table name to a list of items. Each object in /Responses/ consists of+-- a table name, along with a map of attribute data consisting of the data type+-- and attribute value. bgirResponses :: Lens' BatchGetItemResponse (HashMap Text [HashMap Text AttributeValue]) bgirResponses = lens _bgirResponses (\s a -> s { _bgirResponses = a }) . _Map --- | A map of tables and their respective keys that were not processed with--- the current response. The UnprocessedKeys value is in the same form as--- RequestItems, so the value can be provided directly to a subsequent--- BatchGetItem operation. For more information, see RequestItems in the--- Request Parameters section. Each element consists of: Keys - An array of--- primary key attribute values that define specific items in the table.--- AttributesToGet - One or more attributes to be retrieved from the table--- or index. By default, all attributes are returned. If a specified--- attribute is not found, it does not appear in the result. ConsistentRead--- - The consistency of a read operation. If set to true, then a strongly--- consistent read is used; otherwise, an eventually consistent read is--- used. If there are no unprocessed keys remaining, the response contains--- an empty UnprocessedKeys map.+-- | A map of tables and their respective keys that were not processed with the+-- current response. The /UnprocessedKeys/ value is in the same form as /RequestItems/, so the value can be provided directly to a subsequent /BatchGetItem/+-- operation. For more information, see /RequestItems/ in the Request Parameters+-- section.+--+-- Each element consists of:+--+-- /Keys/ - An array of primary key attribute values that define specific items+-- in the table.+--+-- /AttributesToGet/ - One or more attributes to be retrieved from the table or+-- index. By default, all attributes are returned. If a specified attribute is+-- not found, it does not appear in the result.+--+-- /ConsistentRead/ - The consistency of a read operation. If set to 'true', then+-- a strongly consistent read is used; otherwise, an eventually consistent read+-- is used.+--+-- If there are no unprocessed keys remaining, the response contains an empty /UnprocessedKeys/ map. bgirUnprocessedKeys :: Lens' BatchGetItemResponse (HashMap Text KeysAndAttributes) bgirUnprocessedKeys = lens _bgirUnprocessedKeys (\s a -> s { _bgirUnprocessedKeys = a })
gen/Network/AWS/DynamoDB/BatchWriteItem.hs view
@@ -20,56 +20,70 @@ -- Stability : experimental -- Portability : non-portable (GHC extensions) --- | The BatchWriteItem operation puts or deletes multiple items in one or more--- tables. A single call to BatchWriteItem can write up to 16 MB of data,--- which can comprise as many as 25 put or delete requests. Individual items--- to be written can be as large as 400 KB. 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 internal processing--- failure occurs, the failed operations are returned in the UnprocessedItems--- response parameter. You can investigate and optionally resend the requests.--- Typically, you would call BatchWriteItem in a loop. Each iteration would--- check for unprocessed items and submit a new BatchWriteItem request with--- those unprocessed items until all items have been processed. Note that if--- none of the items can be processed due to insufficient provisioned--- throughput on all of the tables in the request, then BatchWriteItem will--- return a ProvisionedThroughputExceededException. If DynamoDB returns any--- unprocessed items, you should retry the batch operation on those items.--- However, we strongly recommend that you use an exponential backoff--- algorithm. If you retry the batch operation immediately, the underlying--- read or write requests can still fail due to throttling on the individual--- tables. If you delay the batch operation using exponential backoff, the--- individual requests in the batch are much more likely to succeed. For more--- information, go to Batch Operations and Error Handling in the Amazon--- DynamoDB Developer Guide. With BatchWriteItem, you can efficiently write or--- delete large amounts of data, such as from Amazon Elastic MapReduce (EMR),--- or copy data from another database into DynamoDB. In order to improve--- performance with these large-scale operations, BatchWriteItem does not--- behave in the same way as individual PutItem and DeleteItem calls would For--- example, you cannot specify conditions on individual put and delete--- requests, and BatchWriteItem does not return deleted items in the response.+-- | The /BatchWriteItem/ operation puts or deletes multiple items in one or more+-- tables. A single call to /BatchWriteItem/ can write up to 16 MB of data, which+-- can comprise as many as 25 put or delete requests. Individual items to be+-- written can be as large as 400 KB.+--+-- 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+-- internal processing failure occurs, the failed operations are returned in the /UnprocessedItems/ response parameter. You can investigate and optionally+-- resend the requests. Typically, you would call /BatchWriteItem/ in a loop. Each+-- iteration would check for unprocessed items and submit a new /BatchWriteItem/+-- request with those unprocessed items until all items have been processed.+--+-- Note that if /none/ of the items can be processed due to insufficient+-- provisioned throughput on all of the tables in the request, then /BatchWriteItem/ will return a /ProvisionedThroughputExceededException/.+--+-- If DynamoDB returns any unprocessed items, you should retry the batch+-- operation on those items. However, /we strongly recommend that you use anexponential backoff algorithm/. If you retry the batch operation immediately,+-- the underlying read or write requests can still fail due to throttling on the+-- individual tables. If you delay the batch operation using exponential+-- backoff, the individual requests in the batch are much more likely to succeed.+--+-- For more information, go to <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#BatchOperations Batch Operations and Error Handling> in the /Amazon DynamoDB Developer Guide/.+--+-- With /BatchWriteItem/, you can efficiently write or delete large amounts of+-- data, such as from Amazon Elastic MapReduce (EMR), or copy data from another+-- database into DynamoDB. In order to improve performance with these+-- large-scale operations, /BatchWriteItem/ does not behave in the same way as+-- individual /PutItem/ and /DeleteItem/ calls would For example, you cannot specify+-- conditions on individual put and delete requests, and /BatchWriteItem/ does not+-- return deleted items in the response.+-- -- If you use a programming language that supports concurrency, such as Java,--- you can use threads to write items in parallel. Your application must--- include the necessary logic to manage the threads. With languages that--- don't support threading, such as PHP, you must update or delete the--- specified items one at a time. In both situations, BatchWriteItem provides--- an alternative where the API performs the specified put and delete--- operations in parallel, giving you the power of the thread pool approach--- without having to introduce complexity into your application. Parallel--- processing reduces latency, but each specified put and delete request--- consumes the same number of write capacity units whether it is processed in--- parallel or not. Delete operations on nonexistent items consume one write--- capacity unit. If one or more of the following is true, DynamoDB rejects--- the entire batch write operation: One or more tables specified in the--- BatchWriteItem request does not exist. Primary key attributes specified on--- an item in the request do not match those in the corresponding table's--- primary key schema. You try to perform multiple operations on the same item--- in the same BatchWriteItem request. For example, you cannot put and delete--- the same item in the same BatchWriteItem request. There are more than 25--- requests in the batch. Any individual item in a batch exceeds 400 KB. The--- total request size exceeds 16 MB.+-- you can use threads to write items in parallel. Your application must include+-- the necessary logic to manage the threads. With languages that don't support+-- threading, such as PHP, you must update or delete the specified items one at+-- a time. In both situations, /BatchWriteItem/ provides an alternative where the+-- API performs the specified put and delete operations in parallel, giving you+-- the power of the thread pool approach without having to introduce complexity+-- into your application. --+-- Parallel processing reduces latency, but each specified put and delete+-- request consumes the same number of write capacity units whether it is+-- processed in parallel or not. Delete operations on nonexistent items consume+-- one write capacity unit.+--+-- If one or more of the following is true, DynamoDB rejects the entire batch+-- write operation:+--+-- One or more tables specified in the /BatchWriteItem/ request does not exist.+--+-- Primary key attributes specified on an item in the request do not match+-- those in the corresponding table's primary key schema.+--+-- You try to perform multiple operations on the same item in the same /BatchWriteItem/ request. For example, you cannot put and delete the same item in the same /BatchWriteItem/ request.+--+-- There are more than 25 requests in the batch.+--+-- Any individual item in a batch exceeds 400 KB.+--+-- The total request size exceeds 16 MB.+--+--+-- -- <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_BatchWriteItem.html> module Network.AWS.DynamoDB.BatchWriteItem (@@ -120,26 +134,34 @@ , _bwiReturnItemCollectionMetrics = Nothing } --- | A map of one or more table names and, for each table, a list of--- operations to be performed (DeleteRequest or PutRequest). Each element in--- the map consists of the following: DeleteRequest - Perform a DeleteItem--- operation on the specified item. The item to be deleted is identified by--- a Key subelement: Key - A map of primary key attribute values that--- uniquely identify the ! item. Each entry in this map consists of an--- attribute name and an attribute value. For each primary key, you must--- provide all of the key attributes. For example, with a hash type primary--- key, you only need to specify the hash attribute. For a hash-and-range--- type primary key, you must specify both the hash attribute and the range--- attribute. PutRequest - Perform a PutItem operation on the specified--- item. The item to be put is identified by an Item subelement: Item - A--- map of attributes and their values. Each entry in this map consists of an--- attribute name and an attribute value. Attribute values must not be null;--- string and binary type attributes must have lengths greater than zero;--- and set type attributes must not be empty. Requests that contain empty--- values will be rejected with a ValidationException exception. If you--- specify any attributes that are part of an index key, then the data types--- for those attributes must match those of the schema in the table's+-- | A map of one or more table names and, for each table, a list of operations to+-- be performed (/DeleteRequest/ or /PutRequest/). Each element in the map consists+-- of the following:+--+-- /DeleteRequest/ - Perform a /DeleteItem/ operation on the specified item. The+-- item to be deleted is identified by a /Key/ subelement:+--+-- /Key/ - A map of primary key attribute values that uniquely identify the !+-- item. Each entry in this map consists of an attribute name and an attribute+-- value. For each primary key, you must provide /all/ of the key attributes. For+-- example, with a hash type primary key, you only need to specify the hash+-- attribute. For a hash-and-range type primary key, you must specify /both/ the+-- hash attribute and the range attribute.+--+-- /PutRequest/ - Perform a /PutItem/ operation on the specified item. The item+-- to be put is identified by an /Item/ subelement:+--+-- /Item/ - A map of attributes and their values. Each entry in this map+-- consists of an attribute name and an attribute value. Attribute values must+-- not be null; string and binary type attributes must have lengths greater than+-- zero; and set type attributes must not be empty. Requests that contain empty+-- values will be rejected with a /ValidationException/ exception.+--+-- If you specify any attributes that are part of an index key, then the data+-- types for those attributes must match those of the schema in the table's -- attribute definition.+--+-- bwiRequestItems :: Lens' BatchWriteItem (HashMap Text (NonEmpty WriteRequest)) bwiRequestItems = lens _bwiRequestItems (\s a -> s { _bwiRequestItems = a }) . _Map @@ -148,10 +170,9 @@ lens _bwiReturnConsumedCapacity (\s a -> s { _bwiReturnConsumedCapacity = a }) --- | A value that if set to SIZE, the response includes statistics about item--- collections, if any, that were modified during the operation are returned--- in the response. If set to NONE (the default), no statistics are--- returned.+-- | A value that if set to 'SIZE', the response includes statistics about item+-- collections, if any, that were modified during the operation are returned in+-- the response. If set to 'NONE' (the default), no statistics are returned. bwiReturnItemCollectionMetrics :: Lens' BatchWriteItem (Maybe ReturnItemCollectionMetrics) bwiReturnItemCollectionMetrics = lens _bwiReturnItemCollectionMetrics@@ -180,55 +201,75 @@ , _bwirConsumedCapacity = mempty } --- | The capacity units consumed by the operation. Each element consists of:--- TableName - The table that consumed the provisioned throughput.--- CapacityUnits - The total number of capacity units consumed.+-- | The capacity units consumed by the operation.+--+-- Each element consists of:+--+-- /TableName/ - The table that consumed the provisioned throughput.+--+-- /CapacityUnits/ - The total number of capacity units consumed.+--+-- bwirConsumedCapacity :: Lens' BatchWriteItemResponse [ConsumedCapacity] bwirConsumedCapacity = lens _bwirConsumedCapacity (\s a -> s { _bwirConsumedCapacity = a }) . _List --- | A list of tables that were processed by BatchWriteItem and, for each--- table, information about any item collections that were affected by--- individual DeleteItem or PutItem operations. Each entry consists of the--- following subelements: ItemCollectionKey - The hash key value of the item--- collection. This is the same as the hash key of the item.--- SizeEstimateRange - An estimate of item collection size, expressed in GB.--- This is a two-element array containing a lower bound and an upper bound--- for the estimate. The estimate includes the size of all the items in the--- table, plus the size of all attributes projected into all of the local--- secondary indexes on the table. Use this estimate to measure whether a--- local secondary index is approaching its size limit. The estimate is--- subject to change over time; therefore, do not rely on the precision or--- accuracy of the estimate.+-- | A list of tables that were processed by /BatchWriteItem/ and, for each table,+-- information about any item collections that were affected by individual /DeleteItem/ or /PutItem/ operations.+--+-- Each entry consists of the following subelements:+--+-- /ItemCollectionKey/ - The hash key value of the item collection. This is the+-- same as the hash key of the item.+--+-- /SizeEstimateRange/ - An estimate of item collection size, expressed in GB.+-- This is a two-element array containing a lower bound and an upper bound for+-- the estimate. The estimate includes the size of all the items in the table,+-- plus the size of all attributes projected into all of the local secondary+-- indexes on the table. Use this estimate to measure whether a local secondary+-- index is approaching its size limit.+--+-- The estimate is subject to change over time; therefore, do not rely on the+-- precision or accuracy of the estimate.+--+-- bwirItemCollectionMetrics :: Lens' BatchWriteItemResponse (HashMap Text [ItemCollectionMetrics]) bwirItemCollectionMetrics = lens _bwirItemCollectionMetrics (\s a -> s { _bwirItemCollectionMetrics = a }) . _Map --- | A map of tables and requests against those tables that were not--- processed. The UnprocessedItems value is in the same form as--- RequestItems, so you can provide this value directly to a subsequent--- BatchGetItem operation. For more information, see RequestItems in the--- Request Parameters section. Each UnprocessedItems entry consists of a--- table name and, for that table, a list of operations to perform--- (DeleteRequest or PutRequest). DeleteRequest - Perform a DeleteItem--- operation on the specified item. The item to be deleted is identified by--- a Key subelement: Key - A map of primary key attribute values that--- uniquely identify the item. Each entry in this map consists of an--- attribute name and an attribute value. PutRequest - Perform a PutItem--- operation on the specified item. The item to be put is identified by an--- Item subelement: Item - A map of attributes and their values. Each entry--- in this map consists of an attribute name and an attribute value.--- Attribute values must not be null; string and binary type attributes must--- have lengths greater than zero; and set type attributes must not be--- empty. Requests that contain empty values will be rejected with a--- ValidationException exception. If you specify any attributes that are--- part of an index key, then the data types for those attributes must match--- those of the schema in the table's attribute definition. If there are no--- unprocessed items remaining, the response contains an empty--- UnprocessedItems map.+-- | A map of tables and requests against those tables that were not processed.+-- The /UnprocessedItems/ value is in the same form as /RequestItems/, so you can+-- provide this value directly to a subsequent /BatchGetItem/ operation. For more+-- information, see /RequestItems/ in the Request Parameters section.+--+-- Each /UnprocessedItems/ entry consists of a table name and, for that table, a+-- list of operations to perform (/DeleteRequest/ or /PutRequest/).+--+-- /DeleteRequest/ - Perform a /DeleteItem/ operation on the specified item. The+-- item to be deleted is identified by a /Key/ subelement:+--+-- /Key/ - A map of primary key attribute values that uniquely identify the+-- item. Each entry in this map consists of an attribute name and an attribute+-- value.+--+-- /PutRequest/ - Perform a /PutItem/ operation on the specified item. The item+-- to be put is identified by an /Item/ subelement:+--+-- /Item/ - A map of attributes and their values. Each entry in this map+-- consists of an attribute name and an attribute value. Attribute values must+-- not be null; string and binary type attributes must have lengths greater than+-- zero; and set type attributes must not be empty. Requests that contain empty+-- values will be rejected with a /ValidationException/ exception.+--+-- If you specify any attributes that are part of an index key, then the data+-- types for those attributes must match those of the schema in the table's+-- attribute definition.+--+-- If there are no unprocessed items remaining, the response contains an+-- empty /UnprocessedItems/ map. bwirUnprocessedItems :: Lens' BatchWriteItemResponse (HashMap Text (NonEmpty WriteRequest)) bwirUnprocessedItems = lens _bwirUnprocessedItems (\s a -> s { _bwirUnprocessedItems = a })
gen/Network/AWS/DynamoDB/CreateTable.hs view
@@ -20,18 +20,20 @@ -- Stability : experimental -- Portability : non-portable (GHC extensions) --- | The CreateTable operation adds a new table to your account. In an AWS--- account, table names must be unique within each region. That is, you can--- have two tables with same name if you create the tables in different--- regions. CreateTable is an asynchronous operation. Upon receiving a--- CreateTable 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 use the--- DescribeTable API to check the table status.+-- | The /CreateTable/ operation adds a new table to your account. In an AWS+-- account, table names must be unique within each region. That is, you can have+-- two tables with same name if you create the tables in different regions. --+-- /CreateTable/ is an asynchronous operation. Upon receiving a /CreateTable/+-- 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 use the /DescribeTable/ API to check the table status.+-- -- <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_CreateTable.html> module Network.AWS.DynamoDB.CreateTable (@@ -98,33 +100,46 @@ , _ctGlobalSecondaryIndexes = mempty } --- | An array of attributes that describe the key schema for the table and--- indexes.+-- | An array of attributes that describe the key schema for the table and indexes. ctAttributeDefinitions :: Lens' CreateTable [AttributeDefinition] ctAttributeDefinitions = lens _ctAttributeDefinitions (\s a -> s { _ctAttributeDefinitions = a }) . _List --- | One or more global secondary indexes (the maximum is five) to be created--- on the table. Each global secondary index in the array includes the--- following: IndexName - The name of the global secondary index. Must be--- unique only for this table. KeySchema - Specifies the key schema for the--- global secondary index. Projection - Specifies attributes that are copied--- (projected) from the table into the index. These are in addition to the--- primary key attributes and index key attributes, which are automatically--- projected. Each attribute specification is composed of: ProjectionType ---- One of the following: KEYS_ONLY - Only the index and primary keys are--- projected into the index. INCLUDE - Only the specified table attributes--- are projected into the index. The list of projected attributes are in--- NonKeyAttributes. ALL - All of the table attributes are projected into--- the index. NonKeyAttributes - A list of one or more non-key attribute--- names that are projected into the secondary index. The total count of--- attributes specified in NonKeyAttributes, summed across all of the--- secondary indexes, must not exceed 20. If you project the same attribute--- into two different indexes, this counts as two distinct attributes when--- determining the total. ProvisionedThroughput - The provisioned throughput--- settings for the global secondary index, consisting of read and write--- capacity units.+-- | One or more global secondary indexes (the maximum is five) to be created on+-- the table. Each global secondary index in the array includes the following:+--+-- /IndexName/ - The name of the global secondary index. Must be unique only+-- for this table.+--+--+--+-- /KeySchema/ - Specifies the key schema for the global secondary index.+--+-- /Projection/ - Specifies attributes that are copied (projected) from the+-- table into the index. These are in addition to the primary key attributes and+-- index key attributes, which are automatically projected. Each attribute+-- specification is composed of:+--+-- /ProjectionType/ - One of the following:+--+-- 'KEYS_ONLY' - Only the index and primary keys are projected into the index.+--+-- 'INCLUDE' - Only the specified table attributes are projected into the+-- index. The list of projected attributes are in /NonKeyAttributes/.+--+-- 'ALL' - All of the table attributes are projected into the index.+--+-- /NonKeyAttributes/ - A list of one or more non-key attribute names that+-- are projected into the secondary index. The total count of attributes+-- specified in /NonKeyAttributes/, summed across all of the secondary indexes,+-- must not exceed 20. If you project the same attribute into two different+-- indexes, this counts as two distinct attributes when determining the total.+--+-- /ProvisionedThroughput/ - The provisioned throughput settings for the+-- global secondary index, consisting of read and write capacity units.+--+-- ctGlobalSecondaryIndexes :: Lens' CreateTable [GlobalSecondaryIndex] ctGlobalSecondaryIndexes = lens _ctGlobalSecondaryIndexes@@ -132,41 +147,60 @@ . _List -- | Specifies the attributes that make up the primary key for a table or an--- index. The attributes in KeySchema must also be defined in the--- AttributeDefinitions array. For more information, see Data Model in the--- Amazon DynamoDB Developer Guide. Each KeySchemaElement in the array is--- composed of: AttributeName - The name of this key attribute. KeyType ---- Determines whether the key attribute is HASH or RANGE. For a primary key--- that consists of a hash attribute, you must specify exactly one element--- with a KeyType of HASH. For a primary key that consists of hash and range--- attributes, you must specify exactly two elements, in this order: The--- first element must have a KeyType of HASH, and the second element must--- have a KeyType of RANGE. For more information, see Specifying the Primary--- Key in the Amazon DynamoDB Developer Guide.+-- index. The attributes in /KeySchema/ must also be defined in the /AttributeDefinitions/ array. For more information, see <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html Data Model> in the /Amazon DynamoDB DeveloperGuide/.+--+-- Each /KeySchemaElement/ in the array is composed of:+--+-- /AttributeName/ - The name of this key attribute.+--+-- /KeyType/ - Determines whether the key attribute is 'HASH' or 'RANGE'.+--+-- For a primary key that consists of a hash attribute, you must specify+-- exactly one element with a /KeyType/ of 'HASH'.+--+-- For a primary key that consists of hash and range attributes, you must+-- specify exactly two elements, in this order: The first element must have a /KeyType/ of 'HASH', and the second element must have a /KeyType/ of 'RANGE'.+--+-- For more information, see <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#WorkingWithTables.primary.key Specifying the Primary Key> in the /Amazon DynamoDBDeveloper Guide/. ctKeySchema :: Lens' CreateTable (NonEmpty KeySchemaElement) ctKeySchema = lens _ctKeySchema (\s a -> s { _ctKeySchema = a }) . _List1 --- | One or more local secondary indexes (the maximum is five) to be created--- on the table. Each index is scoped to a given hash key value. There is a--- 10 GB size limit per hash key; otherwise, the size of a local secondary--- index is unconstrained. Each local secondary index in the array includes--- the following: IndexName - The name of the local secondary index. Must be--- unique only for this table. KeySchema - Specifies the key schema for the--- local secondary index. The key schema must begin with the same hash key--- attribute as the table. Projection - Specifies attributes that are copied--- (projected) from the table into the index. These are in addition to the--- primary key attributes and index key attributes, which are automatically--- projected. Each attribute specification is composed of: ProjectionType ---- One of the following: KEYS_ONLY - Only the index and primary keys are--- projected into the index. INCLUDE - Only the specified table attributes--- are projected into the index. The list of projected attributes are in--- NonKeyAttributes. ALL - All of the table attributes are projected into--- the index. NonKeyAttributes - A list of one or more non-key attribute--- names that are projected into the secondary index. The total count of--- attributes specified in NonKeyAttributes, summed across all of the--- secondary indexes, must not exceed 20. If you project the same attribute--- into two different indexes, this counts as two distinct attributes when--- determining the total.+-- | One or more local secondary indexes (the maximum is five) to be created on+-- the table. Each index is scoped to a given hash key value. There is a 10 GB+-- size limit per hash key; otherwise, the size of a local secondary index is+-- unconstrained.+--+-- Each local secondary index in the array includes the following:+--+-- /IndexName/ - The name of the local secondary index. Must be unique only for+-- this table.+--+--+--+-- /KeySchema/ - Specifies the key schema for the local secondary index. The+-- key schema must begin with the same hash key attribute as the table.+--+-- /Projection/ - Specifies attributes that are copied (projected) from the+-- table into the index. These are in addition to the primary key attributes and+-- index key attributes, which are automatically projected. Each attribute+-- specification is composed of:+--+-- /ProjectionType/ - One of the following:+--+-- 'KEYS_ONLY' - Only the index and primary keys are projected into the index.+--+-- 'INCLUDE' - Only the specified table attributes are projected into the+-- index. The list of projected attributes are in /NonKeyAttributes/.+--+-- 'ALL' - All of the table attributes are projected into the index.+--+-- /NonKeyAttributes/ - A list of one or more non-key attribute names that+-- are projected into the secondary index. The total count of attributes+-- specified in /NonKeyAttributes/, summed across all of the secondary indexes,+-- must not exceed 20. If you project the same attribute into two different+-- indexes, this counts as two distinct attributes when determining the total.+--+-- ctLocalSecondaryIndexes :: Lens' CreateTable [LocalSecondaryIndex] ctLocalSecondaryIndexes = lens _ctLocalSecondaryIndexes (\s a -> s { _ctLocalSecondaryIndexes = a })
gen/Network/AWS/DynamoDB/DeleteItem.hs view
@@ -21,16 +21,20 @@ -- Portability : non-portable (GHC extensions) -- | Deletes a single item in a table by primary key. You can perform a--- conditional delete operation that deletes the item if it exists, or if it--- has an expected attribute value. In addition to deleting an item, you can--- also return the item's attribute values in the same operation, using the--- ReturnValues parameter. Unless you specify conditions, the DeleteItem is an--- idempotent operation; running it multiple times on the same item or--- attribute does not result in an error response. Conditional deletes are--- useful for deleting items only if specific conditions are met. If those--- conditions are met, DynamoDB performs the delete. Otherwise, the item is--- not deleted.+-- conditional delete operation that deletes the item if it exists, or if it has+-- an expected attribute value. --+-- In addition to deleting an item, you can also return the item's attribute+-- values in the same operation, using the /ReturnValues/ parameter.+--+-- Unless you specify conditions, the /DeleteItem/ is an idempotent operation;+-- running it multiple times on the same item or attribute does /not/ result in an+-- error response.+--+-- Conditional deletes are useful for deleting items only if specific+-- conditions are met. If those conditions are met, DynamoDB performs the+-- delete. Otherwise, the item is not deleted.+-- -- <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html> module Network.AWS.DynamoDB.DeleteItem (@@ -117,191 +121,283 @@ , _diExpressionAttributeValues = mempty } --- | A condition that must be satisfied in order for a conditional DeleteItem--- to succeed. An expression can contain any of the following: Boolean--- functions: ATTRIBUTE_EXIST | CONTAINS | BEGINS_WITH Comparison operators:--- = | <> | < | > | <= | >= | BETWEEN | IN--- Logical operators: NOT | AND | OR.+-- | A condition that must be satisfied in order for a conditional /DeleteItem/ to+-- succeed.+--+-- An expression can contain any of the following:+--+-- Boolean functions: 'ATTRIBUTE_EXIST | CONTAINS | BEGINS_WITH'+--+-- Comparison operators: ' = | <> | < | > | <= | >= | BETWEEN | IN'+--+-- Logical operators: 'NOT | AND | OR'+--+-- diConditionExpression :: Lens' DeleteItem (Maybe Text) diConditionExpression = lens _diConditionExpression (\s a -> s { _diConditionExpression = a }) --- | 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. A logical operator to apply to--- the conditions in the Expected map: AND - If all of the conditions--- evaluate to true, then the entire map evaluates to true. OR - If at least--- one of the conditions evaluate to true, then the entire map evaluates to--- true. If you omit ConditionalOperator, then AND is the default. The--- operation will succeed only if the entire map evaluates to true.+-- | 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.+--+-- A logical operator to apply to the conditions in the /Expected/ map:+--+-- 'AND' - If all of the conditions evaluate to true, then the entire map+-- evaluates to true.+--+-- 'OR' - If at least one of the conditions evaluate to true, then the entire map+-- evaluates to true.+--+-- If you omit /ConditionalOperator/, then 'AND' is the default.+--+-- The operation will succeed only if the entire map evaluates to true. diConditionalOperator :: Lens' DeleteItem (Maybe ConditionalOperator) diConditionalOperator = lens _diConditionalOperator (\s a -> s { _diConditionalOperator = a }) --- | There is a newer parameter available. Use ConditionExpression instead.--- Note that if you use Expected and ConditionExpression at the same time,--- DynamoDB will return a ValidationException exception. This parameter does--- not support lists or maps. A map of attribute/condition pairs. Expected--- provides a conditional block for the DeleteItem operation. Each element--- of Expected consists of an attribute name, a comparison operator, and one--- or more values. DynamoDB compares the attribute with the value(s) you--- supplied, using the comparison operator. For each Expected element, the--- result of the evaluation is either true or false. If you specify more--- than one element in the Expected 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.) If the Expected map--- evaluates to true, then the conditional operation succeeds; otherwise, it--- fails. Expected contains the following: AttributeValueList - One or more--- values to evaluate against the supplied attribute. The number of values--- in the list depends on the ComparisonOperator being used. 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 greater than B. For a--- list of code values, see--- http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters. For type--- Binary, DynamoDB treats each byte of the binary data as unsigned when it--- compares binary values, for example when evaluating query expressions.--- ComparisonOperator - A comparator for evaluating attributes in the--- AttributeValueList. When performing the comparison, DynamoDB uses--- strongly consistent reads. The following comparison operators are--- available: EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS |--- NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN The following are descriptions--- of each comparison operator. EQ : Equal. EQ is supported for all--- datatypes, including lists and maps. AttributeValueList can contain only--- one AttributeValue element of type String, Number, Binary, String Set,--- Number Set, or Binary Set. If an item contains an AttributeValue element--- of a different type than the one specified in the request, the value does--- not match. For example, {"S":"6"} does not equal {"N":"6"}. Also,--- {"N":"6"} does not equal {"NS":["6", "2", "1"]}. NE : Not equal. NE is--- supported for all datatypes, including lists and maps. AttributeValueList--- can contain only one AttributeValue of type String, Number, Binary,--- String Set, Number Set, or Binary Set. If an item contains an--- AttributeValue of a different type than the one specified in the request,--- the value does not match. For example, {"S":"6"} does not equal--- {"N":"6"}. Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}. LE :--- Less than or equal. AttributeValueList can contain only one--- AttributeValue element of type String, Number, or Binary (not a set--- type). If an item contains an AttributeValue element of a different type--- than the one specified in the request, the value does not match. For--- example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not--- compare to {"NS":["6", "2", "1"]}. LT : Less than. AttributeValueList can--- contain only one AttributeValue of type String, Number, or Binary (not a--- set type). If an item contains an AttributeValue element of a different--- type than the one specified in the request, the value does not match. For--- example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not--- compare to {"NS":["6", "2", "1"]}. GE : Greater than or equal.--- AttributeValueList can contain only one AttributeValue element of type--- String, Number, or Binary (not a set type). If an item contains an--- AttributeValue element of a different type than the one specified in the--- request, the value does not match. For example, {"S":"6"} does not equal--- {"N":"6"}. Also, {"N":"6"} does not compare to {"NS":["6", "2", "1"]}. GT--- : Greater than. AttributeValueList can contain only one AttributeValue--- element of type String, Number, or Binary (not a set type). If an item--- contains an AttributeValue element of a different type than the one--- specified in the request, the value does not match. For example,--- {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not compare to--- {"NS":["6", "2", "1"]}. NOT_NULL : The attribute exists. NOT_NULL is--- supported for all datatypes, including lists and maps. NULL : The--- attribute does not exist. NULL is supported for all datatypes, including--- lists and maps. CONTAINS : Checks for a subsequence, or value in a set.--- AttributeValueList can contain only one AttributeValue element of type--- String, Number, or Binary (not a set type). If the target attribute of--- the comparison is of type String, then the operator checks for a--- substring match. If the target attribute of the comparison is of type--- Binary, then the operator looks for a subsequence of the target that--- matches the input. If the target attribute of the comparison is a set--- ("SS", "NS", or "BS"), then the operator evaluates to true if it finds an--- exact match with any member of the set. CONTAINS is supported for lists:--- When evaluating "a CONTAINS b", "a" can be a list; however, "b" cannot be--- a set, a map, or a list. NOT_CONTAINS : Checks for absence of a--- subsequence, or absence of a value in a set. AttributeValueList can--- contain only one AttributeValue element of type String, Number, or Binary--- (not a set type). If the target attribute of the comparison is a String,--- then the operator checks for the absence of a substring match. If the--- target attribute of the comparison is Binary, then the operator checks--- for the absence of a subsequence of the target that matches the input. If--- the target attribute of the comparison is a set ("SS", "NS", or "BS"),--- then the operator evaluates to true if it does not find an exact match--- with any member of the set. NOT_CONTAINS is supported for lists: When--- evaluating "a NOT CONTAINS b", "a" can be a list; however, "b" cannot be--- a set, a map, or a list. BEGINS_WITH : Checks for a prefix.--- AttributeValueList can contain only one AttributeValue of type String or--- Binary (not a Number or a set type). The target attribute of the--- comparison must be of type String or Binary (not a Number or a set type).--- IN : Checks for matching elements within two sets. AttributeValueList can--- contain one or more AttributeValue elements of type String, Number, or--- Binary (not a set type). These attributes are compared against an--- existing set type attribute of an item. If any elements of the input set--- are present in the item attribute, the expression evaluates to true.--- BETWEEN : Greater than or equal to the first value, and less than or--- equal to the second value. AttributeValueList must contain two--- AttributeValue elements of the same type, either String, Number, or--- Binary (not a set type). A target attribute matches if the target value--- is greater than, or equal to, the first element and less than, or equal--- to, the second element. If an item contains an AttributeValue element of--- a different type than the one specified in the request, the value does--- not match. For example, {"S":"6"} does not compare to {"N":"6"}. Also,--- {"N":"6"} does not compare to {"NS":["6", "2", "1"]} For usage examples--- of AttributeValueList and ComparisonOperator, see Legacy Conditional--- Parameters in the Amazon DynamoDB Developer Guide. For backward--- compatibility with previous DynamoDB releases, the following parameters--- can be used instead of AttributeValueList and ComparisonOperator: Value ---- A value for DynamoDB to compare with an attribute. Exists - A Boolean--- value that causes DynamoDB to evaluate the value before attempting the--- conditional operation: If Exists is true, DynamoDB will check to see if--- that attribute value already exists in the table. If it is found, then--- the condition evaluates to true; otherwise the condition evaluate to--- false. If Exists is false, DynamoDB assumes that the attribute value does--- not exist in the table. If in fact the value does not exist, then the--- assumption 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. 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.+-- | There is a newer parameter available. Use /ConditionExpression/ instead. Note+-- that if you use /Expected/ and / ConditionExpression / at the same time, DynamoDB+-- will return a /ValidationException/ exception.+--+-- This parameter does not support lists or maps.+--+-- A map of attribute/condition pairs. /Expected/ provides a conditional block+-- for the /DeleteItem/ operation.+--+-- Each element of /Expected/ consists of an attribute name, a comparison+-- operator, and one or more values. DynamoDB compares the attribute with the+-- value(s) you supplied, using the comparison operator. For each /Expected/+-- element, the result of the evaluation is either true or false.+--+-- If you specify more than one element in the /Expected/ 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.)+--+-- If the /Expected/ map evaluates to true, then the conditional operation+-- succeeds; otherwise, it fails.+--+-- /Expected/ contains the following:+--+-- /AttributeValueList/ - One or more values to evaluate against the supplied+-- attribute. The number of values in the list depends on the /ComparisonOperator/+-- being used.+--+-- 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+-- 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+-- when it compares binary values, for example when evaluating query expressions.+--+-- /ComparisonOperator/ - A comparator for evaluating attributes in the /AttributeValueList/. When performing the comparison, DynamoDB uses strongly consistent reads.+--+-- The following comparison operators are available:+--+-- 'EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS |BEGINS_WITH | IN | BETWEEN'+--+-- The following are descriptions of each comparison operator.+--+-- 'EQ' : Equal. 'EQ' is supported for all datatypes, including lists and maps.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, Binary, String Set, Number Set, or Binary Set. If an item+-- contains an /AttributeValue/ element of a different type than the one specified+-- in the request, the value does not match. For example, '{"S":"6"}' does not+-- equal '{"N":"6"}'. Also, '{"N":"6"}' does not equal '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'NE' : Not equal. 'NE' is supported for all datatypes, including lists and+-- maps.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ of type String,+-- Number, Binary, String Set, Number Set, or Binary Set. If an item contains an /AttributeValue/ of a different type than the one specified in the request, the+-- value does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not equal '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'LE' : Less than or equal.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'LT' : Less than.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ of type String,+-- Number, or Binary (not a set type). If an item contains an /AttributeValue/+-- element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'GE' : Greater than or equal.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'GT' : Greater than.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'NOT_NULL' : The attribute exists. 'NOT_NULL' is supported for all datatypes,+-- including lists and maps.+--+-- 'NULL' : The attribute does not exist. 'NULL' is supported for all datatypes,+-- including lists and maps.+--+-- 'CONTAINS' : Checks for a subsequence, or value in a set.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If the target attribute of the+-- comparison is of type String, then the operator checks for a substring match.+-- If the target attribute of the comparison is of type Binary, then the+-- operator looks for a subsequence of the target that matches the input. If the+-- target attribute of the comparison is a set ("'SS'", "'NS'", or "'BS'"), then the+-- operator evaluates to true if it finds an exact match with any member of the+-- set.+--+-- CONTAINS is supported for lists: When evaluating "'a CONTAINS b'", "'a'" can be+-- a list; however, "'b'" cannot be a set, a map, or a list.+--+-- 'NOT_CONTAINS' : Checks for absence of a subsequence, or absence of a value+-- in a set.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If the target attribute of the+-- comparison is a String, then the operator checks for the absence of a+-- substring match. If the target attribute of the comparison is Binary, then+-- the operator checks for the absence of a subsequence of the target that+-- matches the input. If the target attribute of the comparison is a set ("'SS'", "'NS'", or "'BS'"), then the operator evaluates to true if it /does not/ find an+-- exact match with any member of the set.+--+-- NOT_CONTAINS is supported for lists: When evaluating "'a NOT CONTAINS b'", "'a'"+-- can be a list; however, "'b'" cannot be a set, a map, or a list.+--+-- 'BEGINS_WITH' : Checks for a prefix.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ of type String or+-- Binary (not a Number or a set type). The target attribute of the comparison+-- must be of type String or Binary (not a Number or a set type).+--+--+--+-- 'IN' : Checks for matching elements within two sets.+--+-- /AttributeValueList/ can contain one or more /AttributeValue/ elements of type+-- String, Number, or Binary (not a set type). These attributes are compared+-- against an existing set type attribute of an item. If any elements of the+-- input set are present in the item attribute, the expression evaluates to true.+--+-- 'BETWEEN' : Greater than or equal to the first value, and less than or equal+-- to the second value.+--+-- /AttributeValueList/ must contain two /AttributeValue/ elements of the same+-- type, either String, Number, or Binary (not a set type). A target attribute+-- matches if the target value is greater than, or equal to, the first element+-- and less than, or equal to, the second element. If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not compare to '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'+--+-- For usage examples of /AttributeValueList/ and /ComparisonOperator/, see <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.html Legacy Conditional Parameters> in the /Amazon DynamoDB Developer Guide/.+--+-- For backward compatibility with previous DynamoDB releases, the following+-- parameters can be used instead of /AttributeValueList/ and /ComparisonOperator/:+--+-- /Value/ - A value for DynamoDB to compare with an attribute.+--+-- /Exists/ - A Boolean value that causes DynamoDB to evaluate the value before+-- attempting the conditional operation:+--+-- If /Exists/ is 'true', DynamoDB will check to see if that attribute value+-- already exists in the table. If it is found, then the condition evaluates to+-- true; otherwise the condition evaluate to false.+--+-- If /Exists/ is 'false', DynamoDB assumes that the attribute value does /not/+-- exist in the table. If in fact the value does not exist, then the assumption+-- 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.+--+-- 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. diExpected :: Lens' DeleteItem (HashMap Text ExpectedAttributeValue) 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: To--- shorten an attribute name that is very long or unwieldy in an expression.+-- following are some use cases for an /ExpressionAttributeNames/ value:+--+-- To shorten an attribute name that is very long or unwieldy in an+-- expression.+-- -- To create a placeholder for repeating occurrences of an attribute name in--- an expression. To prevent special characters in an attribute name from--- being misinterpreted in an expression. Use the # character in an--- expression to dereference an attribute name. For example, consider the--- following expression: order.customerInfo.LastName = "Smith" OR--- order.customerInfo.LastName = "Jones" Now suppose that you specified the--- following for ExpressionAttributeNames:--- {"n":"order.customerInfo.LastName"} The expression can now be simplified--- as follows: #n = "Smith" OR #n = "Jones".+-- an expression.+--+-- To prevent special characters in an attribute name from being+-- misinterpreted in an expression.+--+-- Use the # character in an expression to dereference an attribute name. For+-- example, consider the following expression:+--+-- 'order.customerInfo.LastName = "Smith" OR order.customerInfo.LastName ="Jones"'+--+-- Now suppose that you specified the following for /ExpressionAttributeNames/:+--+-- '{"n":"order.customerInfo.LastName"}'+--+-- The expression can now be simplified as follows:+--+-- '#n = "Smith" OR #n = "Jones"'+-- diExpressionAttributeNames :: Lens' DeleteItem (HashMap Text Text) diExpressionAttributeNames = lens _diExpressionAttributeNames (\s a -> s { _diExpressionAttributeNames = a }) . _Map --- | 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: ProductStatus IN--- ("Available","Backordered","Discontinued") Now suppose that you specified--- the following for ExpressionAttributeValues: { "a":{"S":"Available"},--- "b":{"S":"Backordered"}, "d":{"S":"Discontinued"} } The expression can--- now be simplified as follows: ProductStatus IN (:a,:b,:c).+-- | 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:+--+-- 'ProductStatus IN ("Available","Backordered","Discontinued")'+--+-- Now suppose that you specified the following for /ExpressionAttributeValues/:+--+-- '{ "a":{"S":"Available"}, "b":{"S":"Backordered"}, "d":{"S":"Discontinued"} }'+--+-- The expression can now be simplified as follows:+--+-- 'ProductStatus IN (:a,:b,:c)'+-- diExpressionAttributeValues :: Lens' DeleteItem (HashMap Text AttributeValue) diExpressionAttributeValues = lens _diExpressionAttributeValues (\s a -> s { _diExpressionAttributeValues = a }) . _Map --- | A map of attribute names to AttributeValue objects, representing the--- primary key of the item to delete. For the primary key, you must provide--- all of the attributes. For example, with a hash type primary key, you--- only need to specify the hash attribute. For a hash-and-range type--- primary key, you must specify both the hash attribute and the range--- attribute.+-- | A map of attribute names to /AttributeValue/ objects, representing the primary+-- key of the item to delete.+--+-- For the primary key, you must provide all of the attributes. For example,+-- with a hash type primary key, you only need to specify the hash attribute.+-- For a hash-and-range type primary key, you must specify both the hash+-- attribute and the range attribute. diKey :: Lens' DeleteItem (HashMap Text AttributeValue) diKey = lens _diKey (\s a -> s { _diKey = a }) . _Map @@ -310,20 +406,23 @@ lens _diReturnConsumedCapacity (\s a -> s { _diReturnConsumedCapacity = a }) --- | A value that if set to SIZE, the response includes statistics about item--- collections, if any, that were modified during the operation are returned--- in the response. If set to NONE (the default), no statistics are--- returned.+-- | A value that if set to 'SIZE', the response includes statistics about item+-- collections, if any, that were modified during the operation are returned in+-- the response. If set to 'NONE' (the default), no statistics are returned. diReturnItemCollectionMetrics :: Lens' DeleteItem (Maybe ReturnItemCollectionMetrics) diReturnItemCollectionMetrics = lens _diReturnItemCollectionMetrics (\s a -> s { _diReturnItemCollectionMetrics = a }) --- | Use ReturnValues if you want to get the item attributes as they appeared--- before they were deleted. For DeleteItem, the valid values are: NONE - If--- ReturnValues is not specified, or if its value is NONE, then nothing is--- returned. (This setting is the default for ReturnValues.) ALL_OLD - The--- content of the old item is returned.+-- | Use /ReturnValues/ if you want to get the item attributes as they appeared+-- before they were deleted. For /DeleteItem/, the valid values are:+--+-- 'NONE' - If /ReturnValues/ is not specified, or if its value is 'NONE', then+-- nothing is returned. (This setting is the default for /ReturnValues/.)+--+-- 'ALL_OLD' - The content of the old item is returned.+--+-- diReturnValues :: Lens' DeleteItem (Maybe ReturnValue) diReturnValues = lens _diReturnValues (\s a -> s { _diReturnValues = a }) @@ -354,9 +453,9 @@ , _dirItemCollectionMetrics = Nothing } --- | A map of attribute names to AttributeValue objects, representing the item--- as it appeared before the DeleteItem operation. This map appears in the--- response only if ReturnValues was specified as ALL_OLD in the request.+-- | A map of attribute names to /AttributeValue/ objects, representing the item as+-- it appeared before the /DeleteItem/ operation. This map appears in the response+-- only if /ReturnValues/ was specified as 'ALL_OLD' in the request. dirAttributes :: Lens' DeleteItemResponse (HashMap Text AttributeValue) dirAttributes = lens _dirAttributes (\s a -> s { _dirAttributes = a }) . _Map @@ -365,19 +464,26 @@ lens _dirConsumedCapacity (\s a -> s { _dirConsumedCapacity = a }) -- | Information about item collections, if any, that were affected by the--- operation. ItemCollectionMetrics is only returned if the request asked--- for it. If the table does not have any local secondary indexes, this--- information is not returned in the response. Each ItemCollectionMetrics--- element consists of: ItemCollectionKey - The hash key value of the item--- collection. This is the same as the hash key of the item.--- SizeEstimateRange - An estimate of item collection size, in gigabytes.--- This value is a two-element array containing a lower bound and an upper--- bound for the estimate. The estimate includes the size of all the items--- in the table, plus the size of all attributes projected into all of the--- local secondary indexes on that table. Use this estimate to measure--- whether a local secondary index is approaching its size limit. The--- estimate is subject to change over time; therefore, do not rely on the+-- operation. /ItemCollectionMetrics/ is only returned if the request asked for+-- it. If the table does not have any local secondary indexes, this information+-- is not returned in the response.+--+-- Each /ItemCollectionMetrics/ element consists of:+--+-- /ItemCollectionKey/ - The hash key value of the item collection. This is the+-- same as the hash key of the item.+--+-- /SizeEstimateRange/ - An estimate of item collection size, in gigabytes. This+-- value is a two-element array containing a lower bound and an upper bound for+-- the estimate. The estimate includes the size of all the items in the table,+-- plus the size of all attributes projected into all of the local secondary+-- indexes on that table. Use this estimate to measure whether a local secondary+-- index is approaching its size limit.+--+-- The estimate is subject to change over time; therefore, do not rely on the -- precision or accuracy of the estimate.+--+-- dirItemCollectionMetrics :: Lens' DeleteItemResponse (Maybe ItemCollectionMetrics) dirItemCollectionMetrics = lens _dirItemCollectionMetrics
gen/Network/AWS/DynamoDB/DeleteTable.hs view
@@ -20,15 +20,13 @@ -- Stability : experimental -- Portability : non-portable (GHC extensions) --- | The DeleteTable operation deletes a table and all of its items. After a--- DeleteTable request, the specified table is in the DELETING state until--- DynamoDB 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. When you delete a table, any indexes--- on that table are also deleted. Use the DescribeTable API to check the--- status of the table.+-- | The /DeleteTable/ operation deletes a table and all of its items. After a /DeleteTable/ request, the specified table is in the 'DELETING' state until DynamoDB+-- 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.+--+-- When you delete a table, any indexes on that table are also deleted.+--+-- Use the /DescribeTable/ API to check the status of the table. -- -- <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteTable.html> module Network.AWS.DynamoDB.DeleteTable
gen/Network/AWS/DynamoDB/GetItem.hs view
@@ -20,13 +20,14 @@ -- Stability : experimental -- Portability : non-portable (GHC extensions) --- | The GetItem operation returns a set of attributes for the item with the--- given primary key. If there is no matching item, GetItem does not return--- any data. GetItem provides an eventually consistent read by default. If--- your application requires a strongly consistent read, set ConsistentRead to--- true. Although a strongly consistent read might take more time than an--- eventually consistent read, it always returns the last updated value.+-- | The /GetItem/ operation returns a set of attributes for the item with the given+-- primary key. If there is no matching item, /GetItem/ does not return any data. --+-- /GetItem/ provides an eventually consistent read by default. If your+-- application requires a strongly consistent read, set /ConsistentRead/ to 'true'.+-- Although a strongly consistent read might take more time than an eventually+-- consistent read, it always returns the last updated value.+-- -- <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_GetItem.html> module Network.AWS.DynamoDB.GetItem (@@ -98,59 +99,78 @@ , _giExpressionAttributeNames = mempty } --- | There is a newer parameter available. Use ProjectionExpression instead.--- Note that if you use AttributesToGet and ProjectionExpression at the same--- time, DynamoDB will return a ValidationException exception. This--- parameter allows you to retrieve lists or maps; however, it cannot--- retrieve individual list or map elements. The names of one or more--- attributes to retrieve. 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. Note that AttributesToGet has--- no effect on provisioned throughput consumption. DynamoDB determines--- capacity units consumed based on item size, not on the amount of data--- that is returned to an application.+-- | There is a newer parameter available. Use /ProjectionExpression/ instead. Note+-- that if you use /AttributesToGet/ and /ProjectionExpression/ at the same time,+-- DynamoDB will return a /ValidationException/ exception.+--+-- This parameter allows you to retrieve lists or maps; however, it cannot+-- retrieve individual list or map elements.+--+-- The names of one or more attributes to retrieve. 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.+--+-- Note that /AttributesToGet/ has no effect on provisioned throughput+-- consumption. DynamoDB determines capacity units consumed based on item size,+-- not on the amount of data that is returned to an application. giAttributesToGet :: Lens' GetItem (NonEmpty Text) giAttributesToGet = lens _giAttributesToGet (\s a -> s { _giAttributesToGet = a }) . _List1 --- | A value that if set to true, then the operation uses strongly consistent+-- | A value that if set to 'true', then the operation uses strongly consistent -- reads; otherwise, eventually consistent reads are used. giConsistentRead :: Lens' GetItem (Maybe Bool) 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: To--- shorten an attribute name that is very long or unwieldy in an expression.+-- following are some use cases for an /ExpressionAttributeNames/ value:+--+-- To shorten an attribute name that is very long or unwieldy in an+-- expression.+-- -- To create a placeholder for repeating occurrences of an attribute name in--- an expression. To prevent special characters in an attribute name from--- being misinterpreted in an expression. Use the # character in an--- expression to dereference an attribute name. For example, consider the--- following expression: order.customerInfo.LastName = "Smith" OR--- order.customerInfo.LastName = "Jones" Now suppose that you specified the--- following for ExpressionAttributeNames:--- {"n":"order.customerInfo.LastName"} The expression can now be simplified--- as follows: #n = "Smith" OR #n = "Jones".+-- an expression.+--+-- To prevent special characters in an attribute name from being+-- misinterpreted in an expression.+--+-- Use the # character in an expression to dereference an attribute name. For+-- example, consider the following expression:+--+-- 'order.customerInfo.LastName = "Smith" OR order.customerInfo.LastName ="Jones"'+--+-- Now suppose that you specified the following for /ExpressionAttributeNames/:+--+-- '{"n":"order.customerInfo.LastName"}'+--+-- The expression can now be simplified as follows:+--+-- '#n = "Smith" OR #n = "Jones"'+-- giExpressionAttributeNames :: Lens' GetItem (HashMap Text Text) giExpressionAttributeNames = lens _giExpressionAttributeNames (\s a -> s { _giExpressionAttributeNames = a }) . _Map --- | A map of attribute names to AttributeValue objects, representing the--- primary key of the item to retrieve. For the primary key, you must--- provide all of the attributes. For example, with a hash type primary key,--- you only need to specify the hash attribute. For a hash-and-range type--- primary key, you must specify both the hash attribute and the range--- attribute.+-- | A map of attribute names to /AttributeValue/ objects, representing the primary+-- key of the item to retrieve.+--+-- For the primary key, you must provide all of the attributes. For example,+-- with a hash type primary key, you only need to specify the hash attribute.+-- For a hash-and-range type primary key, you must specify both the hash+-- attribute and the range attribute. 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. 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.+-- 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. giProjectionExpression :: Lens' GetItem (Maybe Text) giProjectionExpression = lens _giProjectionExpression (\s a -> s { _giProjectionExpression = a })@@ -187,8 +207,7 @@ girConsumedCapacity = lens _girConsumedCapacity (\s a -> s { _girConsumedCapacity = a }) --- | A map of attribute names to AttributeValue objects, as specified by--- AttributesToGet.+-- | A map of attribute names to /AttributeValue/ objects, as specified by /AttributesToGet/. girItem :: Lens' GetItemResponse (HashMap Text AttributeValue) girItem = lens _girItem (\s a -> s { _girItem = a }) . _Map
gen/Network/AWS/DynamoDB/ListTables.hs view
@@ -21,8 +21,8 @@ -- Portability : non-portable (GHC extensions) -- | Returns an array of table names associated with the current account and--- endpoint. The output from ListTables is paginated, with each page returning--- a maximum of 100 table names.+-- endpoint. The output from /ListTables/ is paginated, with each page returning a+-- maximum of 100 table names. -- -- <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ListTables.html> module Network.AWS.DynamoDB.ListTables@@ -68,9 +68,9 @@ , _ltLimit = Nothing } --- | The first table name that this operation will evaluate. Use the value--- that was returned for LastEvaluatedTableName in a previous operation, so--- that you can obtain the next page of results.+-- | The first table name that this operation will evaluate. Use the value that+-- was returned for /LastEvaluatedTableName/ in a previous operation, so that you+-- can obtain the next page of results. ltExclusiveStartTableName :: Lens' ListTables (Maybe Text) ltExclusiveStartTableName = lens _ltExclusiveStartTableName@@ -100,21 +100,23 @@ , _ltrLastEvaluatedTableName = Nothing } --- | The name of the last table in the current page of results. Use this value--- as the ExclusiveStartTableName in a new request to obtain the next page--- of results, until all the table names are returned. If you do not receive--- a LastEvaluatedTableName value in the response, this means that there are--- no more table names to be retrieved.+-- | The name of the last table in the current page of results. Use this value as+-- the /ExclusiveStartTableName/ in a new request to obtain the next page of+-- results, until all the table names are returned.+--+-- If you do not receive a /LastEvaluatedTableName/ value in the response, this+-- means that there are no more table names to be retrieved. ltrLastEvaluatedTableName :: Lens' ListTablesResponse (Maybe Text) ltrLastEvaluatedTableName = lens _ltrLastEvaluatedTableName (\s a -> s { _ltrLastEvaluatedTableName = a }) --- | The names of the tables associated with the current account at the--- current endpoint. The maximum size of this array is 100. If--- LastEvaluatedTableName also appears in the output, you can use this value--- as the ExclusiveStartTableName parameter in a subsequent ListTables--- request and obtain the next page of results.+-- | The names of the tables associated with the current account at the current+-- endpoint. The maximum size of this array is 100.+--+-- If /LastEvaluatedTableName/ also appears in the output, you can use this value+-- as the /ExclusiveStartTableName/ parameter in a subsequent /ListTables/ request+-- and obtain the next page of results. ltrTableNames :: Lens' ListTablesResponse [Text] ltrTableNames = lens _ltrTableNames (\s a -> s { _ltrTableNames = a }) . _List
gen/Network/AWS/DynamoDB/PutItem.hs view
@@ -20,23 +20,28 @@ -- Stability : experimental -- Portability : non-portable (GHC extensions) --- | Creates a new item, or replaces an old item with a new item. If an item--- that has the same primary key as the new item already exists in the--- specified table, the new item completely replaces the existing item. You--- can perform a conditional put operation (add a new item if one with the--- specified primary key doesn't exist), or replace an existing item if it has--- certain attribute values. In addition to putting an item, you can also--- return the item's attribute values in the same operation, using the--- ReturnValues parameter. When you add an item, the primary key attribute(s)--- are the only required attributes. Attribute values cannot be null. String--- and Binary type attributes must have lengths greater than zero. Set type--- attributes cannot be empty. Requests with empty values will be rejected--- with a ValidationException exception. You can request that PutItem return--- either a copy of the original item (before the update) or a copy of the--- updated item (after the update). For more information, see the ReturnValues--- description below. For more information about using this API, see Working--- with Items in the Amazon DynamoDB Developer Guide.+-- | Creates a new item, or replaces an old item with a new item. If an item that+-- has the same primary key as the new item already exists in the specified+-- table, the new item completely replaces the existing item. You can perform a+-- conditional put operation (add a new item if one with the specified primary+-- key doesn't exist), or replace an existing item if it has certain attribute+-- values. --+-- In addition to putting an item, you can also return the item's attribute+-- values in the same operation, using the /ReturnValues/ parameter.+--+-- When you add an item, the primary key attribute(s) are the only required+-- attributes. Attribute values cannot be null. String and Binary type+-- attributes must have lengths greater than zero. Set type attributes cannot be+-- empty. Requests with empty values will be rejected with a /ValidationException/+-- exception.+--+-- You can request that /PutItem/ return either a copy of the original item+-- (before the update) or a copy of the updated item (after the update). For+-- more information, see the /ReturnValues/ description below.+--+-- 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> module Network.AWS.DynamoDB.PutItem (@@ -123,196 +128,292 @@ , _piExpressionAttributeValues = mempty } --- | A condition that must be satisfied in order for a conditional PutItem--- operation to succeed. An expression can contain any of the following:--- Boolean functions: ATTRIBUTE_EXIST | CONTAINS | BEGINS_WITH Comparison--- operators: = | <> | < | > | <= | >= |--- BETWEEN | IN Logical operators: NOT | AND | OR.+-- | A condition that must be satisfied in order for a conditional /PutItem/+-- operation to succeed.+--+-- An expression can contain any of the following:+--+-- Boolean functions: 'ATTRIBUTE_EXIST | CONTAINS | BEGINS_WITH'+--+-- Comparison operators: ' = | <> | < | > | <= | >= | BETWEEN | IN'+--+-- Logical operators: 'NOT | AND | OR'+--+-- piConditionExpression :: Lens' PutItem (Maybe Text) piConditionExpression = lens _piConditionExpression (\s a -> s { _piConditionExpression = a }) --- | 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. A logical operator to apply to--- the conditions in the Expected map: AND - If all of the conditions--- evaluate to true, then the entire map evaluates to true. OR - If at least--- one of the conditions evaluate to true, then the entire map evaluates to--- true. If you omit ConditionalOperator, then AND is the default. The--- operation will succeed only if the entire map evaluates to true.+-- | 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.+--+-- A logical operator to apply to the conditions in the /Expected/ map:+--+-- 'AND' - If all of the conditions evaluate to true, then the entire map+-- evaluates to true.+--+-- 'OR' - If at least one of the conditions evaluate to true, then the entire map+-- evaluates to true.+--+-- If you omit /ConditionalOperator/, then 'AND' is the default.+--+-- The operation will succeed only if the entire map evaluates to true. piConditionalOperator :: Lens' PutItem (Maybe ConditionalOperator) piConditionalOperator = lens _piConditionalOperator (\s a -> s { _piConditionalOperator = a }) --- | There is a newer parameter available. Use ConditionExpression instead.--- Note that if you use Expected and ConditionExpression at the same time,--- DynamoDB will return a ValidationException exception. This parameter does--- not support lists or maps. A map of attribute/condition pairs. Expected--- provides a conditional block for the PutItem operation. Each element of--- Expected consists of an attribute name, a comparison operator, and one or--- more values. DynamoDB compares the attribute with the value(s) you--- supplied, using the comparison operator. For each Expected element, the--- result of the evaluation is either true or false. If you specify more--- than one element in the Expected 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.) If the Expected map--- evaluates to true, then the conditional operation succeeds; otherwise, it--- fails. Expected contains the following: AttributeValueList - One or more--- values to evaluate against the supplied attribute. The number of values--- in the list depends on the ComparisonOperator being used. 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 greater than B. For a--- list of code values, see--- http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters. For type--- Binary, DynamoDB treats each byte of the binary data as unsigned when it--- compares binary values, for example when evaluating query expressions.--- ComparisonOperator - A comparator for evaluating attributes in the--- AttributeValueList. When performing the comparison, DynamoDB uses--- strongly consistent reads. The following comparison operators are--- available: EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS |--- NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN The following are descriptions--- of each comparison operator. EQ : Equal. EQ is supported for all--- datatypes, including lists and maps. AttributeValueList can contain only--- one AttributeValue element of type String, Number, Binary, String Set,--- Number Set, or Binary Set. If an item contains an AttributeValue element--- of a different type than the one specified in the request, the value does--- not match. For example, {"S":"6"} does not equal {"N":"6"}. Also,--- {"N":"6"} does not equal {"NS":["6", "2", "1"]}. NE : Not equal. NE is--- supported for all datatypes, including lists and maps. AttributeValueList--- can contain only one AttributeValue of type String, Number, Binary,--- String Set, Number Set, or Binary Set. If an item contains an--- AttributeValue of a different type than the one specified in the request,--- the value does not match. For example, {"S":"6"} does not equal--- {"N":"6"}. Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}. LE :--- Less than or equal. AttributeValueList can contain only one--- AttributeValue element of type String, Number, or Binary (not a set--- type). If an item contains an AttributeValue element of a different type--- than the one specified in the request, the value does not match. For--- example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not--- compare to {"NS":["6", "2", "1"]}. LT : Less than. AttributeValueList can--- contain only one AttributeValue of type String, Number, or Binary (not a--- set type). If an item contains an AttributeValue element of a different--- type than the one specified in the request, the value does not match. For--- example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not--- compare to {"NS":["6", "2", "1"]}. GE : Greater than or equal.--- AttributeValueList can contain only one AttributeValue element of type--- String, Number, or Binary (not a set type). If an item contains an--- AttributeValue element of a different type than the one specified in the--- request, the value does not match. For example, {"S":"6"} does not equal--- {"N":"6"}. Also, {"N":"6"} does not compare to {"NS":["6", "2", "1"]}. GT--- : Greater than. AttributeValueList can contain only one AttributeValue--- element of type String, Number, or Binary (not a set type). If an item--- contains an AttributeValue element of a different type than the one--- specified in the request, the value does not match. For example,--- {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not compare to--- {"NS":["6", "2", "1"]}. NOT_NULL : The attribute exists. NOT_NULL is--- supported for all datatypes, including lists and maps. NULL : The--- attribute does not exist. NULL is supported for all datatypes, including--- lists and maps. CONTAINS : Checks for a subsequence, or value in a set.--- AttributeValueList can contain only one AttributeValue element of type--- String, Number, or Binary (not a set type). If the target attribute of--- the comparison is of type String, then the operator checks for a--- substring match. If the target attribute of the comparison is of type--- Binary, then the operator looks for a subsequence of the target that--- matches the input. If the target attribute of the comparison is a set--- ("SS", "NS", or "BS"), then the operator evaluates to true if it finds an--- exact match with any member of the set. CONTAINS is supported for lists:--- When evaluating "a CONTAINS b", "a" can be a list; however, "b" cannot be--- a set, a map, or a list. NOT_CONTAINS : Checks for absence of a--- subsequence, or absence of a value in a set. AttributeValueList can--- contain only one AttributeValue element of type String, Number, or Binary--- (not a set type). If the target attribute of the comparison is a String,--- then the operator checks for the absence of a substring match. If the--- target attribute of the comparison is Binary, then the operator checks--- for the absence of a subsequence of the target that matches the input. If--- the target attribute of the comparison is a set ("SS", "NS", or "BS"),--- then the operator evaluates to true if it does not find an exact match--- with any member of the set. NOT_CONTAINS is supported for lists: When--- evaluating "a NOT CONTAINS b", "a" can be a list; however, "b" cannot be--- a set, a map, or a list. BEGINS_WITH : Checks for a prefix.--- AttributeValueList can contain only one AttributeValue of type String or--- Binary (not a Number or a set type). The target attribute of the--- comparison must be of type String or Binary (not a Number or a set type).--- IN : Checks for matching elements within two sets. AttributeValueList can--- contain one or more AttributeValue elements of type String, Number, or--- Binary (not a set type). These attributes are compared against an--- existing set type attribute of an item. If any elements of the input set--- are present in the item attribute, the expression evaluates to true.--- BETWEEN : Greater than or equal to the first value, and less than or--- equal to the second value. AttributeValueList must contain two--- AttributeValue elements of the same type, either String, Number, or--- Binary (not a set type). A target attribute matches if the target value--- is greater than, or equal to, the first element and less than, or equal--- to, the second element. If an item contains an AttributeValue element of--- a different type than the one specified in the request, the value does--- not match. For example, {"S":"6"} does not compare to {"N":"6"}. Also,--- {"N":"6"} does not compare to {"NS":["6", "2", "1"]} For usage examples--- of AttributeValueList and ComparisonOperator, see Legacy Conditional--- Parameters in the Amazon DynamoDB Developer Guide. For backward--- compatibility with previous DynamoDB releases, the following parameters--- can be used instead of AttributeValueList and ComparisonOperator: Value ---- A value for DynamoDB to compare with an attribute. Exists - A Boolean--- value that causes DynamoDB to evaluate the value before attempting the--- conditional operation: If Exists is true, DynamoDB will check to see if--- that attribute value already exists in the table. If it is found, then--- the condition evaluates to true; otherwise the condition evaluate to--- false. If Exists is false, DynamoDB assumes that the attribute value does--- not exist in the table. If in fact the value does not exist, then the--- assumption 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. 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.+-- | There is a newer parameter available. Use /ConditionExpression/ instead. Note+-- that if you use /Expected/ and / ConditionExpression / at the same time, DynamoDB+-- will return a /ValidationException/ exception.+--+-- This parameter does not support lists or maps.+--+-- A map of attribute/condition pairs. /Expected/ provides a conditional block+-- for the /PutItem/ operation.+--+-- Each element of /Expected/ consists of an attribute name, a comparison+-- operator, and one or more values. DynamoDB compares the attribute with the+-- value(s) you supplied, using the comparison operator. For each /Expected/+-- element, the result of the evaluation is either true or false.+--+-- If you specify more than one element in the /Expected/ 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.)+--+-- If the /Expected/ map evaluates to true, then the conditional operation+-- succeeds; otherwise, it fails.+--+-- /Expected/ contains the following:+--+-- /AttributeValueList/ - One or more values to evaluate against the supplied+-- attribute. The number of values in the list depends on the /ComparisonOperator/+-- being used.+--+-- 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+-- 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+-- when it compares binary values, for example when evaluating query expressions.+--+-- /ComparisonOperator/ - A comparator for evaluating attributes in the /AttributeValueList/. When performing the comparison, DynamoDB uses strongly consistent reads.+--+-- The following comparison operators are available:+--+-- 'EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS |BEGINS_WITH | IN | BETWEEN'+--+-- The following are descriptions of each comparison operator.+--+-- 'EQ' : Equal. 'EQ' is supported for all datatypes, including lists and maps.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, Binary, String Set, Number Set, or Binary Set. If an item+-- contains an /AttributeValue/ element of a different type than the one specified+-- in the request, the value does not match. For example, '{"S":"6"}' does not+-- equal '{"N":"6"}'. Also, '{"N":"6"}' does not equal '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'NE' : Not equal. 'NE' is supported for all datatypes, including lists and+-- maps.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ of type String,+-- Number, Binary, String Set, Number Set, or Binary Set. If an item contains an /AttributeValue/ of a different type than the one specified in the request, the+-- value does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not equal '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'LE' : Less than or equal.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'LT' : Less than.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ of type String,+-- Number, or Binary (not a set type). If an item contains an /AttributeValue/+-- element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'GE' : Greater than or equal.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'GT' : Greater than.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'NOT_NULL' : The attribute exists. 'NOT_NULL' is supported for all datatypes,+-- including lists and maps.+--+-- 'NULL' : The attribute does not exist. 'NULL' is supported for all datatypes,+-- including lists and maps.+--+-- 'CONTAINS' : Checks for a subsequence, or value in a set.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If the target attribute of the+-- comparison is of type String, then the operator checks for a substring match.+-- If the target attribute of the comparison is of type Binary, then the+-- operator looks for a subsequence of the target that matches the input. If the+-- target attribute of the comparison is a set ("'SS'", "'NS'", or "'BS'"), then the+-- operator evaluates to true if it finds an exact match with any member of the+-- set.+--+-- CONTAINS is supported for lists: When evaluating "'a CONTAINS b'", "'a'" can be+-- a list; however, "'b'" cannot be a set, a map, or a list.+--+-- 'NOT_CONTAINS' : Checks for absence of a subsequence, or absence of a value+-- in a set.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If the target attribute of the+-- comparison is a String, then the operator checks for the absence of a+-- substring match. If the target attribute of the comparison is Binary, then+-- the operator checks for the absence of a subsequence of the target that+-- matches the input. If the target attribute of the comparison is a set ("'SS'", "'NS'", or "'BS'"), then the operator evaluates to true if it /does not/ find an+-- exact match with any member of the set.+--+-- NOT_CONTAINS is supported for lists: When evaluating "'a NOT CONTAINS b'", "'a'"+-- can be a list; however, "'b'" cannot be a set, a map, or a list.+--+-- 'BEGINS_WITH' : Checks for a prefix.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ of type String or+-- Binary (not a Number or a set type). The target attribute of the comparison+-- must be of type String or Binary (not a Number or a set type).+--+--+--+-- 'IN' : Checks for matching elements within two sets.+--+-- /AttributeValueList/ can contain one or more /AttributeValue/ elements of type+-- String, Number, or Binary (not a set type). These attributes are compared+-- against an existing set type attribute of an item. If any elements of the+-- input set are present in the item attribute, the expression evaluates to true.+--+-- 'BETWEEN' : Greater than or equal to the first value, and less than or equal+-- to the second value.+--+-- /AttributeValueList/ must contain two /AttributeValue/ elements of the same+-- type, either String, Number, or Binary (not a set type). A target attribute+-- matches if the target value is greater than, or equal to, the first element+-- and less than, or equal to, the second element. If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not compare to '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'+--+-- For usage examples of /AttributeValueList/ and /ComparisonOperator/, see <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.html Legacy Conditional Parameters> in the /Amazon DynamoDB Developer Guide/.+--+-- For backward compatibility with previous DynamoDB releases, the following+-- parameters can be used instead of /AttributeValueList/ and /ComparisonOperator/:+--+-- /Value/ - A value for DynamoDB to compare with an attribute.+--+-- /Exists/ - A Boolean value that causes DynamoDB to evaluate the value before+-- attempting the conditional operation:+--+-- If /Exists/ is 'true', DynamoDB will check to see if that attribute value+-- already exists in the table. If it is found, then the condition evaluates to+-- true; otherwise the condition evaluate to false.+--+-- If /Exists/ is 'false', DynamoDB assumes that the attribute value does /not/+-- exist in the table. If in fact the value does not exist, then the assumption+-- 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.+--+-- 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. piExpected :: Lens' PutItem (HashMap Text ExpectedAttributeValue) 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: To--- shorten an attribute name that is very long or unwieldy in an expression.+-- following are some use cases for an /ExpressionAttributeNames/ value:+--+-- To shorten an attribute name that is very long or unwieldy in an+-- expression.+-- -- To create a placeholder for repeating occurrences of an attribute name in--- an expression. To prevent special characters in an attribute name from--- being misinterpreted in an expression. Use the # character in an--- expression to dereference an attribute name. For example, consider the--- following expression: order.customerInfo.LastName = "Smith" OR--- order.customerInfo.LastName = "Jones" Now suppose that you specified the--- following for ExpressionAttributeNames:--- {"n":"order.customerInfo.LastName"} The expression can now be simplified--- as follows: #n = "Smith" OR #n = "Jones".+-- an expression.+--+-- To prevent special characters in an attribute name from being+-- misinterpreted in an expression.+--+-- Use the # character in an expression to dereference an attribute name. For+-- example, consider the following expression:+--+-- 'order.customerInfo.LastName = "Smith" OR order.customerInfo.LastName ="Jones"'+--+-- Now suppose that you specified the following for /ExpressionAttributeNames/:+--+-- '{"n":"order.customerInfo.LastName"}'+--+-- The expression can now be simplified as follows:+--+-- '#n = "Smith" OR #n = "Jones"'+-- piExpressionAttributeNames :: Lens' PutItem (HashMap Text Text) piExpressionAttributeNames = lens _piExpressionAttributeNames (\s a -> s { _piExpressionAttributeNames = a }) . _Map --- | 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: ProductStatus IN--- ("Available","Backordered","Discontinued") Now suppose that you specified--- the following for ExpressionAttributeValues: { "a":{"S":"Available"},--- "b":{"S":"Backordered"}, "d":{"S":"Discontinued"} } The expression can--- now be simplified as follows: ProductStatus IN (:a,:b,:c).+-- | 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:+--+-- 'ProductStatus IN ("Available","Backordered","Discontinued")'+--+-- Now suppose that you specified the following for /ExpressionAttributeValues/:+--+-- '{ "a":{"S":"Available"}, "b":{"S":"Backordered"}, "d":{"S":"Discontinued"} }'+--+-- The expression can now be simplified as follows:+--+-- 'ProductStatus IN (:a,:b,:c)'+-- piExpressionAttributeValues :: Lens' PutItem (HashMap Text AttributeValue) piExpressionAttributeValues = lens _piExpressionAttributeValues (\s a -> s { _piExpressionAttributeValues = a }) . _Map --- | A map of attribute name/value pairs, one for each attribute. Only the--- primary key attributes are required; you can optionally provide other--- attribute name-value pairs for the item. You must provide all of the--- attributes for the primary key. For example, with a hash type primary--- key, you only need to specify the hash attribute. For a hash-and-range--- type primary key, you must specify both the hash attribute and the range--- attribute. If you specify any attributes that are part of an index key,--- then the data types for those attributes must match those of the schema--- in the table's attribute definition. For more information about primary--- keys, see Primary Key in the Amazon DynamoDB Developer Guide. Each--- element in the Item map is an AttributeValue object.+-- | A map of attribute name/value pairs, one for each attribute. Only the primary+-- key attributes are required; you can optionally provide other attribute+-- name-value pairs for the item.+--+-- You must provide all of the attributes for the primary key. For example,+-- with a hash type primary key, you only need to specify the hash attribute.+-- For a hash-and-range type primary key, you must specify both the hash+-- attribute and the range attribute.+--+-- If you specify any attributes that are part of an index key, then the data+-- types for those attributes must match those of the schema in the table's+-- attribute definition.+--+-- For more information about primary keys, see <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html#DataModelPrimaryKey Primary Key> in the /AmazonDynamoDB Developer Guide/.+--+-- Each element in the /Item/ map is an /AttributeValue/ object. piItem :: Lens' PutItem (HashMap Text AttributeValue) piItem = lens _piItem (\s a -> s { _piItem = a }) . _Map @@ -321,21 +422,25 @@ lens _piReturnConsumedCapacity (\s a -> s { _piReturnConsumedCapacity = a }) --- | A value that if set to SIZE, the response includes statistics about item--- collections, if any, that were modified during the operation are returned--- in the response. If set to NONE (the default), no statistics are--- returned.+-- | A value that if set to 'SIZE', the response includes statistics about item+-- collections, if any, that were modified during the operation are returned in+-- the response. If set to 'NONE' (the default), no statistics are returned. piReturnItemCollectionMetrics :: Lens' PutItem (Maybe ReturnItemCollectionMetrics) piReturnItemCollectionMetrics = lens _piReturnItemCollectionMetrics (\s a -> s { _piReturnItemCollectionMetrics = a }) --- | Use ReturnValues if you want to get the item attributes as they appeared--- before they were updated with the PutItem request. For PutItem, the valid--- values are: NONE - If ReturnValues is not specified, or if its value is--- NONE, then nothing is returned. (This setting is the default for--- ReturnValues.) ALL_OLD - If PutItem overwrote an attribute name-value--- pair, then the content of the old item is returned.+-- | Use /ReturnValues/ if you want to get the item attributes as they appeared+-- before they were updated with the /PutItem/ request. For /PutItem/, the valid+-- values are:+--+-- 'NONE' - If /ReturnValues/ is not specified, or if its value is 'NONE', then+-- nothing is returned. (This setting is the default for /ReturnValues/.)+--+-- 'ALL_OLD' - If /PutItem/ overwrote an attribute name-value pair, then the+-- content of the old item is returned.+--+-- piReturnValues :: Lens' PutItem (Maybe ReturnValue) piReturnValues = lens _piReturnValues (\s a -> s { _piReturnValues = a }) @@ -366,9 +471,9 @@ , _pirItemCollectionMetrics = Nothing } --- | The attribute values as they appeared before the PutItem operation, but--- only if ReturnValues is specified as ALL_OLD in the request. Each element--- consists of an attribute name and an attribute value.+-- | The attribute values as they appeared before the /PutItem/ operation, but only+-- if /ReturnValues/ is specified as 'ALL_OLD' in the request. Each element consists+-- of an attribute name and an attribute value. pirAttributes :: Lens' PutItemResponse (HashMap Text AttributeValue) pirAttributes = lens _pirAttributes (\s a -> s { _pirAttributes = a }) . _Map @@ -377,19 +482,26 @@ lens _pirConsumedCapacity (\s a -> s { _pirConsumedCapacity = a }) -- | Information about item collections, if any, that were affected by the--- operation. ItemCollectionMetrics is only returned if the request asked--- for it. If the table does not have any local secondary indexes, this--- information is not returned in the response. Each ItemCollectionMetrics--- element consists of: ItemCollectionKey - The hash key value of the item--- collection. This is the same as the hash key of the item.--- SizeEstimateRange - An estimate of item collection size, in gigabytes.--- This value is a two-element array containing a lower bound and an upper--- bound for the estimate. The estimate includes the size of all the items--- in the table, plus the size of all attributes projected into all of the--- local secondary indexes on that table. Use this estimate to measure--- whether a local secondary index is approaching its size limit. The--- estimate is subject to change over time; therefore, do not rely on the+-- operation. /ItemCollectionMetrics/ is only returned if the request asked for+-- it. If the table does not have any local secondary indexes, this information+-- is not returned in the response.+--+-- Each /ItemCollectionMetrics/ element consists of:+--+-- /ItemCollectionKey/ - The hash key value of the item collection. This is the+-- same as the hash key of the item.+--+-- /SizeEstimateRange/ - An estimate of item collection size, in gigabytes. This+-- value is a two-element array containing a lower bound and an upper bound for+-- the estimate. The estimate includes the size of all the items in the table,+-- plus the size of all attributes projected into all of the local secondary+-- indexes on that table. Use this estimate to measure whether a local secondary+-- index is approaching its size limit.+--+-- The estimate is subject to change over time; therefore, do not rely on the -- precision or accuracy of the estimate.+--+-- pirItemCollectionMetrics :: Lens' PutItemResponse (Maybe ItemCollectionMetrics) pirItemCollectionMetrics = lens _pirItemCollectionMetrics
gen/Network/AWS/DynamoDB/Query.hs view
@@ -20,23 +20,26 @@ -- Stability : experimental -- Portability : non-portable (GHC extensions) --- | A Query operation directly accesses items from a table using the table+-- | A /Query/ operation directly accesses items from a table using the table -- primary key, or from an index using the index key. You must provide a -- specific hash key value. You can narrow the scope of the query by using--- comparison operators on the range key value, or on the index key. You can--- use the ScanIndexForward parameter to get results in forward or reverse--- order, by range key or by index key. Queries that do not return results--- consume the minimum number of read capacity units for that type of read--- operation. If the total number of items meeting the query criteria exceeds--- the result set size limit of 1 MB, the query stops and results are returned--- to the user with LastEvaluatedKey to continue the query in a subsequent--- operation. Unlike a Scan operation, a Query operation never returns both an--- empty result set and a LastEvaluatedKey. The LastEvaluatedKey is only--- provided if the results exceed 1 MB, or if you have used Limit. You can--- query a table, a local secondary index, or a global secondary index. For a--- query on a table or on a local secondary index, you can set ConsistentRead--- to true and obtain a strongly consistent result. Global secondary indexes--- support eventually consistent reads only, so do not specify ConsistentRead+-- comparison operators on the range key value, or on the index key. You can use+-- the /ScanIndexForward/ parameter to get results in forward or reverse order, by+-- range key or by index key.+--+-- Queries that do not return results consume the minimum number of read+-- capacity units for that type of read operation.+--+-- If the total number of items meeting the query criteria exceeds the result+-- set size limit of 1 MB, the query stops and results are returned to the user+-- with /LastEvaluatedKey/ to continue the query in a subsequent operation. Unlike+-- a /Scan/ operation, a /Query/ operation never returns both an empty result set+-- and a /LastEvaluatedKey/. The /LastEvaluatedKey/ is only provided if the results+-- exceed 1 MB, or if you have used /Limit/.+--+-- You can query a table, a local secondary index, or a global secondary index.+-- For a query on a table or on a local secondary index, you can set /ConsistentRead/ to true and obtain a strongly consistent result. Global secondary indexes+-- support eventually consistent reads only, so do not specify /ConsistentRead/ -- when querying a global secondary index. -- -- <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html>@@ -158,86 +161,122 @@ , _qExpressionAttributeValues = mempty } --- | There is a newer parameter available. Use ProjectionExpression instead.--- Note that if you use AttributesToGet and ProjectionExpression at the same--- time, DynamoDB will return a ValidationException exception. This--- parameter allows you to retrieve lists or maps; however, it cannot--- retrieve individual list or map elements. The names of one or more--- attributes to retrieve. 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. Note that AttributesToGet has--- no effect on provisioned throughput consumption. DynamoDB determines--- capacity units consumed based on item size, not on the amount of data--- that is returned to an application. You cannot use both AttributesToGet--- and Select together in a Query request, unless the value for Select is--- SPECIFIC_ATTRIBUTES. (This usage is equivalent to specifying--- AttributesToGet without any value for Select.) If you query a local--- secondary index and request only attributes that are projected into that--- index, the operation will read only the index and not the table. If any--- of the requested attributes are not projected into the local secondary--- index, DynamoDB will fetch each of these attributes from the parent+-- | There is a newer parameter available. Use /ProjectionExpression/ instead. Note+-- that if you use /AttributesToGet/ and /ProjectionExpression/ at the same time,+-- DynamoDB will return a /ValidationException/ exception.+--+-- This parameter allows you to retrieve lists or maps; however, it cannot+-- retrieve individual list or map elements.+--+-- The names of one or more attributes to retrieve. 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.+--+-- Note that /AttributesToGet/ has no effect on provisioned throughput+-- consumption. DynamoDB determines capacity units consumed based on item size,+-- not on the amount of data that is returned to an application.+--+-- You cannot use both /AttributesToGet/ and /Select/ together in a /Query/ request, /unless/ the value for /Select/ is 'SPECIFIC_ATTRIBUTES'. (This usage is equivalent to+-- specifying /AttributesToGet/ without any value for /Select/.)+--+-- If you query a local secondary index and request only attributes that are+-- projected into that index, the operation will read only the index and not the+-- table. If any of the requested attributes are not projected into the local+-- secondary index, DynamoDB will fetch each of these attributes from the parent -- table. This extra fetching incurs additional throughput cost and latency.--- If you query a global secondary index, you can only request attributes--- that are projected into the index. Global secondary index queries cannot--- fetch attributes from the parent table.+--+-- If you query a global secondary index, you can only request attributes that+-- are projected into the index. Global secondary index queries cannot fetch+-- attributes from the parent table. 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. A logical operator to apply to--- the conditions in the QueryFilter map: AND - If all of the conditions--- evaluate to true, then the entire map evaluates to true. OR - If at least--- one of the conditions evaluate to true, then the entire map evaluates to--- true. If you omit ConditionalOperator, then AND is the default. The--- operation will succeed only if the entire map evaluates to true.+-- | 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.+--+-- A logical operator to apply to the conditions in the /QueryFilter/ map:+--+-- 'AND' - If all of the conditions evaluate to true, then the entire map+-- evaluates to true.+--+-- 'OR' - If at least one of the conditions evaluate to true, then the entire map+-- evaluates to true.+--+-- If you omit /ConditionalOperator/, then 'AND' is the default.+--+-- The operation will succeed only if the entire map evaluates to true. qConditionalOperator :: Lens' Query (Maybe ConditionalOperator) qConditionalOperator = lens _qConditionalOperator (\s a -> s { _qConditionalOperator = a }) --- | A value that if set to true, then the operation uses strongly consistent--- reads; otherwise, eventually consistent reads are used. Strongly--- consistent reads are not supported on global secondary indexes. If you--- query a global secondary index with ConsistentRead set to true, you will+-- | A value that if set to 'true', then the operation uses strongly consistent+-- reads; otherwise, eventually consistent reads are used.+--+-- Strongly consistent reads are not supported on global secondary indexes. If+-- you query a global secondary index with /ConsistentRead/ set to 'true', you will -- receive an error message. qConsistentRead :: Lens' Query (Maybe Bool) qConsistentRead = lens _qConsistentRead (\s a -> s { _qConsistentRead = a }) --- | The primary key of the first item that this operation will evaluate. Use--- the value that was returned for LastEvaluatedKey in the previous--- operation. The data type for ExclusiveStartKey must be String, Number or--- Binary. No set data types are allowed.+-- | The primary key of the first item that this operation will evaluate. Use the+-- value that was returned for /LastEvaluatedKey/ in the previous operation.+--+-- The data type for /ExclusiveStartKey/ must be String, Number or Binary. No set+-- data types are allowed. qExclusiveStartKey :: Lens' Query (HashMap Text AttributeValue) qExclusiveStartKey = lens _qExclusiveStartKey (\s a -> s { _qExclusiveStartKey = a }) . _Map -- | One or more substitution tokens for simplifying complex expressions. The--- following are some use cases for an ExpressionAttributeNames value: To--- shorten an attribute name that is very long or unwieldy in an expression.+-- following are some use cases for an /ExpressionAttributeNames/ value:+--+-- To shorten an attribute name that is very long or unwieldy in an+-- expression.+-- -- To create a placeholder for repeating occurrences of an attribute name in--- an expression. To prevent special characters in an attribute name from--- being misinterpreted in an expression. Use the # character in an--- expression to dereference an attribute name. For example, consider the--- following expression: order.customerInfo.LastName = "Smith" OR--- order.customerInfo.LastName = "Jones" Now suppose that you specified the--- following for ExpressionAttributeNames:--- {"n":"order.customerInfo.LastName"} The expression can now be simplified--- as follows: #n = "Smith" OR #n = "Jones".+-- an expression.+--+-- To prevent special characters in an attribute name from being+-- misinterpreted in an expression.+--+-- Use the # character in an expression to dereference an attribute name. For+-- example, consider the following expression:+--+-- 'order.customerInfo.LastName = "Smith" OR order.customerInfo.LastName ="Jones"'+--+-- Now suppose that you specified the following for /ExpressionAttributeNames/:+--+-- '{"n":"order.customerInfo.LastName"}'+--+-- The expression can now be simplified as follows:+--+-- '#n = "Smith" OR #n = "Jones"'+-- qExpressionAttributeNames :: Lens' Query (HashMap Text Text) qExpressionAttributeNames = lens _qExpressionAttributeNames (\s a -> s { _qExpressionAttributeNames = a }) . _Map --- | 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: ProductStatus IN--- ("Available","Backordered","Discontinued") Now suppose that you specified--- the following for ExpressionAttributeValues: { "a":{"S":"Available"},--- "b":{"S":"Backordered"}, "d":{"S":"Discontinued"} } The expression can--- now be simplified as follows: ProductStatus IN (:a,:b,:c).+-- | 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:+--+-- 'ProductStatus IN ("Available","Backordered","Discontinued")'+--+-- Now suppose that you specified the following for /ExpressionAttributeValues/:+--+-- '{ "a":{"S":"Available"}, "b":{"S":"Backordered"}, "d":{"S":"Discontinued"} }'+--+-- The expression can now be simplified as follows:+--+-- 'ProductStatus IN (:a,:b,:c)'+-- qExpressionAttributeValues :: Lens' Query (HashMap Text AttributeValue) qExpressionAttributeValues = lens _qExpressionAttributeValues@@ -245,132 +284,185 @@ . _Map -- | A condition that evaluates the query results 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.+-- values.+--+-- The condition you specify is applied to the items queried; any items that do+-- not match the expression are not returned. qFilterExpression :: Lens' Query (Maybe Text) qFilterExpression = lens _qFilterExpression (\s a -> s { _qFilterExpression = a }) --- | The name of an index to query. This index can be any local secondary--- index or global secondary index on the table.+-- | The name of an index to query. This index can be any local secondary index or+-- global secondary index on the table. qIndexName :: Lens' Query (Maybe Text) qIndexName = lens _qIndexName (\s a -> s { _qIndexName = a }) --- | The selection criteria for the query. For a query on a table, you can--- have conditions only on the table primary key attributes. You must--- specify the 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. Each KeyConditions element--- consists of an attribute name to compare, along with the following:--- AttributeValueList - One or more values to evaluate against the supplied--- attribute. The number of values in the list depends on the--- ComparisonOperator being used. 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 greater than B. For a list of code values, see--- http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters. For--- Binary, DynamoDB treats each byte of the binary data as unsigned when it+-- | The selection criteria for the query. For a query on a table, you can have+-- conditions only on the table primary key attributes. You must specify the+-- 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.+--+-- Each /KeyConditions/ element consists of an attribute name to compare, along+-- with the following:+--+-- /AttributeValueList/ - One or more values to evaluate against the supplied+-- attribute. The number of values in the list depends on the /ComparisonOperator/+-- being used.+--+-- 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+-- 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 -- compares binary values, for example when evaluating query expressions.--- ComparisonOperator - A comparator for evaluating attributes, for example,--- equals, greater than, less than, and so on. For KeyConditions, only the--- following comparison operators are supported: EQ | LE | LT | GE | GT |--- BEGINS_WITH | BETWEEN The following are descriptions of these comparison--- operators. EQ : Equal. AttributeValueList can contain only one--- AttributeValue of type String, Number, or Binary (not a set type). If an--- item contains an AttributeValue element of a different type than the one--- specified in the request, the value does not match. For example,--- {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not equal--- {"NS":["6", "2", "1"]}. LE : Less than or equal. AttributeValueList can--- contain only one AttributeValue element of type String, Number, or Binary--- (not a set type). If an item contains an AttributeValue element of a--- different type than the one specified in the request, the value does not--- match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}--- does not compare to {"NS":["6", "2", "1"]}. LT : Less than.--- AttributeValueList can contain only one AttributeValue of type String,--- Number, or Binary (not a set type). If an item contains an AttributeValue--- element of a different type than the one specified in the request, the--- value does not match. For example, {"S":"6"} does not equal {"N":"6"}.--- Also, {"N":"6"} does not compare to {"NS":["6", "2", "1"]}. GE : Greater--- than or equal. AttributeValueList can contain only one AttributeValue--- element of type String, Number, or Binary (not a set type). If an item--- contains an AttributeValue element of a different type than the one--- specified in the request, the value does not match. For example,--- {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not compare to--- {"NS":["6", "2", "1"]}. GT : Greater than. AttributeValueList can contain--- only one AttributeValue element of type String, Number, or Binary (not a--- set type). If an item contains an AttributeValue element of a different--- type than the one specified in the request, the value does not match. For--- example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not--- compare to {"NS":["6", "2", "1"]}. BEGINS_WITH : Checks for a prefix.--- AttributeValueList can contain only one AttributeValue of type String or--- Binary (not a Number or a set type). The target attribute of the--- comparison must be of type String or Binary (not a Number or a set type).--- BETWEEN : Greater than or equal to the first value, and less than or--- equal to the second value. AttributeValueList must contain two--- AttributeValue elements of the same type, either String, Number, or--- Binary (not a set type). A target attribute matches if the target value--- is greater than, or equal to, the first element and less than, or equal--- to, the second element. If an item contains an AttributeValue element of--- a different type than the one specified in the request, the value does--- not match. For example, {"S":"6"} does not compare to {"N":"6"}. Also,--- {"N":"6"} does not compare to {"NS":["6", "2", "1"]} For usage examples--- of AttributeValueList and ComparisonOperator, see Legacy Conditional--- Parameters in the Amazon DynamoDB Developer Guide.+--+-- /ComparisonOperator/ - A comparator for evaluating attributes, for example,+-- equals, greater than, less than, and so on.+--+-- For /KeyConditions/, only the following comparison operators are supported:+--+-- 'EQ | LE | LT | GE | GT | BEGINS_WITH | BETWEEN'+--+-- The following are descriptions of these comparison operators.+--+-- 'EQ' : Equal.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ of type String,+-- Number, or Binary (not a set type). If an item contains an /AttributeValue/+-- element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not equal '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'LE' : Less than or equal.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'LT' : Less than.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ of type String,+-- Number, or Binary (not a set type). If an item contains an /AttributeValue/+-- element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'GE' : Greater than or equal.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'GT' : Greater than.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'BEGINS_WITH' : Checks for a prefix.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ of type String or+-- Binary (not a Number or a set type). The target attribute of the comparison+-- must be of type String or Binary (not a Number or a set type).+--+--+--+-- 'BETWEEN' : Greater than or equal to the first value, and less than or equal+-- to the second value.+--+-- /AttributeValueList/ must contain two /AttributeValue/ elements of the same+-- type, either String, Number, or Binary (not a set type). A target attribute+-- matches if the target value is greater than, or equal to, the first element+-- and less than, or equal to, the second element. If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not compare to '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'+--+-- For usage examples of /AttributeValueList/ and /ComparisonOperator/, see <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.html Legacy Conditional Parameters> in the /Amazon DynamoDB Developer Guide/. qKeyConditions :: Lens' Query (HashMap Text Condition) qKeyConditions = lens _qKeyConditions (\s a -> s { _qKeyConditions = a }) . _Map -- | The maximum number of items to evaluate (not necessarily the number of--- matching items). If DynamoDB processes the number of items up to the--- limit while processing the results, it stops the operation and returns--- the matching values up to that point, and a key in LastEvaluatedKey to--- apply in a subsequent operation, so that you can pick up where you left--- off. Also, if the processed data set size exceeds 1 MB before DynamoDB--- reaches this limit, it stops the operation and returns the matching--- values up to the limit, and a key in LastEvaluatedKey to apply in a--- subsequent operation to continue the operation. For more information, see--- Query and Scan in the Amazon DynamoDB Developer Guide.+-- matching items). If DynamoDB processes the number of items up to the limit+-- while processing the results, it stops the operation and returns the matching+-- values up to that point, and a key in /LastEvaluatedKey/ to apply in a+-- subsequent operation, so that you can pick up where you left off. Also, if+-- the processed data set size exceeds 1 MB before DynamoDB reaches this limit,+-- it stops the operation and returns the matching values up to the limit, and a+-- key in /LastEvaluatedKey/ to apply in a subsequent operation to continue the+-- operation. For more information, see <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html Query and Scan> in the /Amazon DynamoDBDeveloper Guide/. 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. 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.+-- 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. qProjectionExpression :: Lens' Query (Maybe Text) qProjectionExpression = lens _qProjectionExpression (\s a -> s { _qProjectionExpression = a }) --- | There is a newer parameter available. Use FilterExpression instead. Note--- that if you use QueryFilter and FilterExpression at the same time,--- DynamoDB will return a ValidationException exception. This parameter does--- not support lists or maps. A condition that evaluates the query results--- 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.) Each QueryFilter element--- consists of an attribute name to compare, along with the following:--- AttributeValueList - One or more values to evaluate against the supplied--- attribute. The number of values in the list depends on the operator--- specified in ComparisonOperator. 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 greater than B. For a list of code values, see--- http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters. For type--- Binary, DynamoDB treats each byte of the binary data as unsigned when it--- compares binary values, for example when evaluating query expressions.--- For information on specifying data types in JSON, see JSON Data Format in--- the Amazon DynamoDB Developer Guide. ComparisonOperator - A comparator--- for evaluating attributes. For example, equals, greater than, less than,--- etc. The following comparison operators are available: EQ | NE | LE | LT--- | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH | IN--- | BETWEEN For complete descriptions of all comparison operators, see--- API_Condition.html.+-- | There is a newer parameter available. Use /FilterExpression/ instead. Note+-- that if you use /QueryFilter/ and /FilterExpression/ at the same time, DynamoDB+-- will return a /ValidationException/ exception.+--+-- This parameter does not support lists or maps.+--+-- A condition that evaluates the query results 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.)+--+-- Each /QueryFilter/ element consists of an attribute name to compare, along+-- with the following:+--+-- /AttributeValueList/ - One or more values to evaluate against the supplied+-- attribute. The number of values in the list depends on the operator specified+-- in /ComparisonOperator/.+--+-- 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+-- 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+-- when it compares binary values, for example when evaluating query expressions.+--+-- For information on specifying data types in JSON, see <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataFormat.html JSON Data Format> in+-- the /Amazon DynamoDB Developer Guide/.+--+-- /ComparisonOperator/ - A comparator for evaluating attributes. For example,+-- equals, greater than, less than, etc.+--+-- The following comparison operators are available:+--+-- 'EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS |BEGINS_WITH | IN | BETWEEN'+--+-- For complete descriptions of all comparison operators, see <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Condition.html API_Condition.html>+-- .+--+-- qQueryFilter :: Lens' Query (HashMap Text Condition) qQueryFilter = lens _qQueryFilter (\s a -> s { _qQueryFilter = a }) . _Map @@ -378,48 +470,55 @@ qReturnConsumedCapacity = lens _qReturnConsumedCapacity (\s a -> s { _qReturnConsumedCapacity = a }) --- | A value that specifies ascending (true) or descending (false) traversal--- of the index. DynamoDB returns results reflecting the requested order--- determined by the range key. If the data type is Number, the results are--- returned in numeric order. For type String, the results are returned in--- order of ASCII character code values. For type Binary, DynamoDB treats--- each byte of the binary data as unsigned when it compares binary values.--- If ScanIndexForward is not specified, the results are returned in--- ascending order.+-- | A value that specifies ascending (true) or descending (false) traversal of+-- the index. DynamoDB returns results reflecting the requested order determined+-- by the range key. If the data type is Number, the results are returned in+-- numeric order. For type String, the results are returned in order of ASCII+-- character code values. For type Binary, DynamoDB treats each byte of the+-- binary data as unsigned when it compares binary values.+--+-- If /ScanIndexForward/ is not specified, the results are returned in ascending+-- order. qScanIndexForward :: Lens' Query (Maybe Bool) qScanIndexForward = lens _qScanIndexForward (\s a -> s { _qScanIndexForward = a }) -- | The attributes to be returned in the result. You can retrieve all item--- attributes, specific item attributes, the count of matching items, or in--- the case of an index, some or all of the attributes projected into the--- index. ALL_ATTRIBUTES - Returns all of the item attributes from the--- specified table or index. If you query a local secondary index, then for--- each matching item in the index DynamoDB will fetch the entire item from--- the parent table. If the index is configured to project all item--- attributes, then all of the data can be obtained from the local secondary--- index, and no fetching is required. ALL_PROJECTED_ATTRIBUTES - Allowed--- only when querying an index. Retrieves all attributes that have been--- projected into the index. If the index is configured to project all--- attributes, this return value is equivalent to specifying ALL_ATTRIBUTES.--- COUNT - Returns the number of matching items, rather than the matching--- items themselves. SPECIFIC_ATTRIBUTES - Returns only the attributes--- listed in AttributesToGet. This return value is equivalent to specifying--- AttributesToGet without specifying any value for Select. If you query a--- local secondary index and request only attributes that are projected into--- that index, the operation will read only the index and not the table. If--- any of the requested attributes are not projected into the local--- secondary index, DynamoDB will fetch each of these attributes from the--- parent table. This extra fetching incurs additional throughput cost and--- latency. If you query a global secondary index, you can only request--- attributes that are projected into the index. Global secondary index--- queries cannot fetch attributes from the parent table. If neither Select--- nor AttributesToGet are specified, DynamoDB defaults to ALL_ATTRIBUTES--- when accessing a table, and ALL_PROJECTED_ATTRIBUTES when accessing an--- index. You cannot use both Select and AttributesToGet together in a--- single request, unless the value for Select is SPECIFIC_ATTRIBUTES. (This--- usage is equivalent to specifying AttributesToGet without any value for--- Select.).+-- attributes, specific item attributes, the count of matching items, or in the+-- case of an index, some or all of the attributes projected into the index.+--+-- 'ALL_ATTRIBUTES' - Returns all of the item attributes from the specified+-- table or index. If you query a local secondary index, then for each matching+-- item in the index DynamoDB will fetch the entire item from the parent table.+-- If the index is configured to project all item attributes, then all of the+-- data can be obtained from the local secondary index, and no fetching is+-- required.+--+-- 'ALL_PROJECTED_ATTRIBUTES' - Allowed only when querying an index. Retrieves+-- all attributes that have been projected into the index. If the index is+-- configured to project all attributes, this return value is equivalent to+-- specifying 'ALL_ATTRIBUTES'.+--+-- 'COUNT' - Returns the number of matching items, rather than the matching+-- items themselves.+--+-- 'SPECIFIC_ATTRIBUTES' - Returns only the attributes listed in /AttributesToGet/. This return value is equivalent to specifying /AttributesToGet/ without+-- specifying any value for /Select/.+--+-- If you query a local secondary index and request only attributes that are+-- projected into that index, the operation will read only the index and not the+-- table. If any of the requested attributes are not projected into the local+-- secondary index, DynamoDB will fetch each of these attributes from the parent+-- table. This extra fetching incurs additional throughput cost and latency.+--+-- If you query a global secondary index, you can only request attributes that+-- are projected into the index. Global secondary index queries cannot fetch+-- attributes from the parent table.+--+-- If neither /Select/ nor /AttributesToGet/ are specified, DynamoDB defaults to 'ALL_ATTRIBUTES' when accessing a table, and 'ALL_PROJECTED_ATTRIBUTES' when accessing an+-- index. You cannot use both /Select/ and /AttributesToGet/ together in a single+-- request, unless the value for /Select/ is 'SPECIFIC_ATTRIBUTES'. (This usage is+-- equivalent to specifying /AttributesToGet/ without any value for /Select/.) qSelect :: Lens' Query (Maybe Select) qSelect = lens _qSelect (\s a -> s { _qSelect = a }) @@ -462,37 +561,41 @@ qrConsumedCapacity = lens _qrConsumedCapacity (\s a -> s { _qrConsumedCapacity = a }) --- | The number of items in the response. If you used a QueryFilter in the--- request, then Count is the number of items returned after the filter was--- applied, and ScannedCount is the number of matching items before> the--- filter was applied. If you did not use a filter in the request, then--- Count and ScannedCount are the same.+-- | The number of items in the response.+--+-- If you used a /QueryFilter/ in the request, then /Count/ is the number of items+-- returned after the filter was applied, and /ScannedCount/ is the number of+-- matching items before> the filter was applied.+--+-- If you did not use a filter in the request, then /Count/ and /ScannedCount/ are+-- the same. qrCount :: Lens' QueryResponse (Maybe Int) qrCount = lens _qrCount (\s a -> s { _qrCount = a }) --- | An array of item attributes that match the query criteria. Each element--- in this array consists of an attribute name and the value for that--- attribute.+-- | An array of item attributes that match the query criteria. Each element in+-- this array consists of an attribute name and the value for that attribute. qrItems :: Lens' QueryResponse [HashMap Text AttributeValue] qrItems = lens _qrItems (\s a -> s { _qrItems = a }) . _List -- | The primary key of the item where the operation stopped, inclusive of the--- previous result set. Use this value to start a new operation, excluding--- this value in the new request. If LastEvaluatedKey is empty, then the--- "last page" of results has been processed and there is no more data to be--- retrieved. If LastEvaluatedKey is not empty, it does not necessarily mean--- that there is more data in the result set. The only way to know when you--- have reached the end of the result set is when LastEvaluatedKey is empty.+-- previous result set. Use this value to start a new operation, excluding this+-- value in the new request.+--+-- If /LastEvaluatedKey/ is empty, then the "last page" of results has been+-- processed and there is no more data to be retrieved.+--+-- If /LastEvaluatedKey/ is not empty, it does not necessarily mean that there is+-- more data in the result set. The only way to know when you have reached the+-- end of the result set is when /LastEvaluatedKey/ is empty. qrLastEvaluatedKey :: Lens' QueryResponse (HashMap Text AttributeValue) qrLastEvaluatedKey = lens _qrLastEvaluatedKey (\s a -> s { _qrLastEvaluatedKey = a }) . _Map --- | The number of items evaluated, before any QueryFilter is applied. A high--- ScannedCount value with few, or no, Count results indicates an--- inefficient Query operation. For more information, see Count and--- ScannedCount in the Amazon DynamoDB Developer Guide. If you did not use a--- filter in the request, then ScannedCount is the same as Count.+-- | The number of items evaluated, before any /QueryFilter/ is applied. A high /ScannedCount/ value with few, or no, /Count/ results indicates an inefficient /Query/+-- operation. For more information, see <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#Count Count and ScannedCount> in the /AmazonDynamoDB Developer Guide/.+--+-- If you did not use a filter in the request, then /ScannedCount/ is the same as /Count/. qrScannedCount :: Lens' QueryResponse (Maybe Int) qrScannedCount = lens _qrScannedCount (\s a -> s { _qrScannedCount = a })
gen/Network/AWS/DynamoDB/Scan.hs view
@@ -20,19 +20,22 @@ -- Stability : experimental -- Portability : non-portable (GHC extensions) --- | The Scan operation returns one or more items and item attributes by--- accessing every item in the table. To have DynamoDB return fewer items, you--- can provide a ScanFilter operation. If the total number of scanned items--- exceeds the maximum data set size limit of 1 MB, the scan stops and results--- are returned to the user as a LastEvaluatedKey value to continue the scan--- in a subsequent operation. The results also include the number of items--- exceeding the limit. A scan can result in no table data meeting the filter--- criteria. The result set is eventually consistent. By default, Scan--- operations proceed sequentially; however, for faster performance on large--- tables, applications can request a parallel Scan operation by specifying--- the Segment and TotalSegments parameters. For more information, see--- Parallel Scan in the Amazon DynamoDB Developer Guide.+-- | The /Scan/ operation returns one or more items and item attributes by accessing+-- every item in the table. To have DynamoDB return fewer items, you can provide+-- a /ScanFilter/ operation. --+-- If the total number of scanned items exceeds the maximum data set size limit+-- of 1 MB, the scan stops and results are returned to the user as a /LastEvaluatedKey/ value to continue the scan in a subsequent operation. The results also+-- include the number of items exceeding the limit. A scan can result in no+-- table data meeting the filter criteria.+--+-- The result set is eventually consistent.+--+-- By default, /Scan/ operations proceed sequentially; however, for faster+-- performance on large tables, applications can request a parallel /Scan/+-- operation by specifying the /Segment/ and /TotalSegments/ parameters. For more+-- information, see <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#QueryAndScanParallelScan Parallel Scan> in the /Amazon DynamoDB Developer Guide/.+-- -- <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Scan.html> module Network.AWS.DynamoDB.Scan (@@ -142,69 +145,104 @@ , _sExpressionAttributeValues = mempty } --- | There is a newer parameter available. Use ProjectionExpression instead.--- Note that if you use AttributesToGet and ProjectionExpression at the same--- time, DynamoDB will return a ValidationException exception. This--- parameter allows you to retrieve lists or maps; however, it cannot--- retrieve individual list or map elements. The names of one or more--- attributes to retrieve. 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. Note that AttributesToGet has--- no effect on provisioned throughput consumption. DynamoDB determines--- capacity units consumed based on item size, not on the amount of data--- that is returned to an application.+-- | There is a newer parameter available. Use /ProjectionExpression/ instead. Note+-- that if you use /AttributesToGet/ and /ProjectionExpression/ at the same time,+-- DynamoDB will return a /ValidationException/ exception.+--+-- This parameter allows you to retrieve lists or maps; however, it cannot+-- retrieve individual list or map elements.+--+-- The names of one or more attributes to retrieve. 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.+--+-- Note that /AttributesToGet/ has no effect on provisioned throughput+-- consumption. DynamoDB determines capacity units consumed based on item size,+-- not on the amount of data that is returned to an application. sAttributesToGet :: Lens' Scan (NonEmpty Text) sAttributesToGet = lens _sAttributesToGet (\s a -> s { _sAttributesToGet = 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. A logical operator to apply to--- the conditions in the ScanFilter map: AND - If all of the conditions--- evaluate to true, then the entire map evaluates to true. OR - If at least--- one of the conditions evaluate to true, then the entire map evaluates to--- true. If you omit ConditionalOperator, then AND is the default. The--- operation will succeed only if the entire map evaluates to true.+-- | 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.+--+-- A logical operator to apply to the conditions in the /ScanFilter/ map:+--+-- 'AND' - If all of the conditions evaluate to true, then the entire map+-- evaluates to true.+--+-- 'OR' - If at least one of the conditions evaluate to true, then the entire map+-- evaluates to true.+--+-- If you omit /ConditionalOperator/, then 'AND' is the default.+--+-- The operation will succeed only if the entire map evaluates to true. sConditionalOperator :: Lens' Scan (Maybe ConditionalOperator) sConditionalOperator = lens _sConditionalOperator (\s a -> s { _sConditionalOperator = a }) --- | The primary key of the first item that this operation will evaluate. Use--- the value that was returned for LastEvaluatedKey in the previous--- operation. The data type for ExclusiveStartKey must be String, Number or--- Binary. No set data types are allowed. In a parallel scan, a Scan request--- that includes ExclusiveStartKey must specify the same segment whose--- previous Scan returned the corresponding value of LastEvaluatedKey.+-- | The primary key of the first item that this operation will evaluate. Use the+-- value that was returned for /LastEvaluatedKey/ in the previous operation.+--+-- The data type for /ExclusiveStartKey/ must be String, Number or Binary. No set+-- data types are allowed.+--+-- In a parallel scan, a /Scan/ request that includes /ExclusiveStartKey/ must+-- specify the same segment whose previous /Scan/ returned the corresponding value+-- of /LastEvaluatedKey/. sExclusiveStartKey :: Lens' Scan (HashMap Text AttributeValue) sExclusiveStartKey = lens _sExclusiveStartKey (\s a -> s { _sExclusiveStartKey = a }) . _Map -- | One or more substitution tokens for simplifying complex expressions. The--- following are some use cases for an ExpressionAttributeNames value: To--- shorten an attribute name that is very long or unwieldy in an expression.+-- following are some use cases for an /ExpressionAttributeNames/ value:+--+-- To shorten an attribute name that is very long or unwieldy in an+-- expression.+-- -- To create a placeholder for repeating occurrences of an attribute name in--- an expression. To prevent special characters in an attribute name from--- being misinterpreted in an expression. Use the # character in an--- expression to dereference an attribute name. For example, consider the--- following expression: order.customerInfo.LastName = "Smith" OR--- order.customerInfo.LastName = "Jones" Now suppose that you specified the--- following for ExpressionAttributeNames:--- {"n":"order.customerInfo.LastName"} The expression can now be simplified--- as follows: #n = "Smith" OR #n = "Jones".+-- an expression.+--+-- To prevent special characters in an attribute name from being+-- misinterpreted in an expression.+--+-- Use the # character in an expression to dereference an attribute name. For+-- example, consider the following expression:+--+-- 'order.customerInfo.LastName = "Smith" OR order.customerInfo.LastName ="Jones"'+--+-- Now suppose that you specified the following for /ExpressionAttributeNames/:+--+-- '{"n":"order.customerInfo.LastName"}'+--+-- The expression can now be simplified as follows:+--+-- '#n = "Smith" OR #n = "Jones"'+-- sExpressionAttributeNames :: Lens' Scan (HashMap Text Text) sExpressionAttributeNames = lens _sExpressionAttributeNames (\s a -> s { _sExpressionAttributeNames = a }) . _Map --- | 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: ProductStatus IN--- ("Available","Backordered","Discontinued") Now suppose that you specified--- the following for ExpressionAttributeValues: { "a":{"S":"Available"},--- "b":{"S":"Backordered"}, "d":{"S":"Discontinued"} } The expression can--- now be simplified as follows: ProductStatus IN (:a,:b,:c).+-- | 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:+--+-- 'ProductStatus IN ("Available","Backordered","Discontinued")'+--+-- Now suppose that you specified the following for /ExpressionAttributeValues/:+--+-- '{ "a":{"S":"Available"}, "b":{"S":"Backordered"}, "d":{"S":"Discontinued"} }'+--+-- The expression can now be simplified as follows:+--+-- 'ProductStatus IN (:a,:b,:c)'+-- sExpressionAttributeValues :: Lens' Scan (HashMap Text AttributeValue) sExpressionAttributeValues = lens _sExpressionAttributeValues@@ -212,30 +250,33 @@ . _Map -- | A condition that evaluates the scan results and returns only the desired--- values. The condition you specify is applied to the items scanned; any--- items that do not match the expression are not returned.+-- values.+--+-- The condition you specify is applied to the items scanned; any items that do+-- not match the expression are not returned. sFilterExpression :: Lens' Scan (Maybe Text) sFilterExpression = lens _sFilterExpression (\s a -> s { _sFilterExpression = a }) -- | The maximum number of items to evaluate (not necessarily the number of--- matching items). If DynamoDB processes the number of items up to the--- limit while processing the results, it stops the operation and returns--- the matching values up to that point, and a key in LastEvaluatedKey to--- apply in a subsequent operation, so that you can pick up where you left--- off. Also, if the processed data set size exceeds 1 MB before DynamoDB--- reaches this limit, it stops the operation and returns the matching--- values up to the limit, and a key in LastEvaluatedKey to apply in a--- subsequent operation to continue the operation. For more information, see--- Query and Scan in the Amazon DynamoDB Developer Guide.+-- matching items). If DynamoDB processes the number of items up to the limit+-- while processing the results, it stops the operation and returns the matching+-- values up to that point, and a key in /LastEvaluatedKey/ to apply in a+-- subsequent operation, so that you can pick up where you left off. Also, if+-- the processed data set size exceeds 1 MB before DynamoDB reaches this limit,+-- it stops the operation and returns the matching values up to the limit, and a+-- key in /LastEvaluatedKey/ to apply in a subsequent operation to continue the+-- operation. For more information, see <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html Query and Scan> in the /Amazon DynamoDBDeveloper Guide/. 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. 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.+-- 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. sProjectionExpression :: Lens' Scan (Maybe Text) sProjectionExpression = lens _sProjectionExpression (\s a -> s { _sProjectionExpression = a })@@ -244,61 +285,85 @@ sReturnConsumedCapacity = lens _sReturnConsumedCapacity (\s a -> s { _sReturnConsumedCapacity = a }) --- | There is a newer parameter available. Use FilterExpression instead. Note--- that if you use ScanFilter and FilterExpression at the same time,--- DynamoDB will return a ValidationException exception. This parameter does--- not support lists or maps. A condition that evaluates the scan results--- and returns only the desired values. If you specify more than one--- condition in the ScanFilter 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.) Each ScanFilter element--- consists of an attribute name to compare, along with the following:--- AttributeValueList - One or more values to evaluate against the supplied--- attribute. The number of values in the list depends on the operator--- specified in ComparisonOperator . 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 greater than B. For a list of code values, see--- http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters. For--- Binary, DynamoDB treats each byte of the binary data as unsigned when it+-- | There is a newer parameter available. Use /FilterExpression/ instead. Note+-- that if you use /ScanFilter/ and /FilterExpression/ at the same time, DynamoDB+-- will return a /ValidationException/ exception.+--+-- This parameter does not support lists or maps.+--+-- A condition that evaluates the scan results and returns only the desired+-- values.+--+-- If you specify more than one condition in the /ScanFilter/ 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.)+--+-- Each /ScanFilter/ element consists of an attribute name to compare, along with+-- the following:+--+-- /AttributeValueList/ - One or more values to evaluate against the supplied+-- attribute. The number of values in the list depends on the operator specified+-- in /ComparisonOperator/ .+--+-- 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+-- 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 -- compares binary values, for example when evaluating query expressions.--- For information on specifying data types in JSON, see JSON Data Format in--- the Amazon DynamoDB Developer Guide. ComparisonOperator - A comparator--- for evaluating attributes. For example, equals, greater than, less than,--- etc. The following comparison operators are available: EQ | NE | LE | LT--- | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH | IN--- | BETWEEN For complete descriptions of all comparison operators, see--- Condition.+--+-- For information on specifying data types in JSON, see <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataFormat.html JSON Data Format> in+-- the /Amazon DynamoDB Developer Guide/.+--+-- /ComparisonOperator/ - A comparator for evaluating attributes. For example,+-- equals, greater than, less than, etc.+--+-- The following comparison operators are available:+--+-- 'EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS |BEGINS_WITH | IN | BETWEEN'+--+-- For complete descriptions of all comparison operators, see <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Condition.html Condition>.+--+-- sScanFilter :: Lens' Scan (HashMap Text Condition) sScanFilter = lens _sScanFilter (\s a -> s { _sScanFilter = a }) . _Map --- | For a parallel Scan request, Segment identifies an individual segment to--- be scanned by an application worker. Segment IDs are zero-based, so the--- first segment is always 0. For example, if you want to scan a table using--- four application threads, the first thread specifies a Segment value of--- 0, the second thread specifies 1, and so on. The value of--- LastEvaluatedKey returned from a parallel Scan request must be used as--- ExclusiveStartKey with the same segment ID in a subsequent Scan--- operation. The value for Segment must be greater than or equal to 0, and--- less than the value provided for TotalSegments. If you specify Segment,--- you must also specify TotalSegments.+-- | For a parallel /Scan/ request, /Segment/ identifies an individual segment to be+-- scanned by an application worker.+--+-- Segment IDs are zero-based, so the first segment is always 0. For example,+-- if you want to scan a table using four application threads, the first thread+-- specifies a /Segment/ value of 0, the second thread specifies 1, and so on.+--+-- The value of /LastEvaluatedKey/ returned from a parallel /Scan/ request must be+-- used as /ExclusiveStartKey/ with the same segment ID in a subsequent /Scan/+-- operation.+--+-- The value for /Segment/ must be greater than or equal to 0, and less than the+-- value provided for /TotalSegments/.+--+-- If you specify /Segment/, you must also specify /TotalSegments/. sSegment :: Lens' Scan (Maybe Natural) sSegment = lens _sSegment (\s a -> s { _sSegment = a }) . mapping _Nat -- | The attributes to be returned in the result. You can retrieve all item -- attributes, specific item attributes, or the count of matching items.--- ALL_ATTRIBUTES - Returns all of the item attributes. COUNT - Returns the--- number of matching items, rather than the matching items themselves.--- SPECIFIC_ATTRIBUTES - Returns only the attributes listed in--- AttributesToGet. This return value is equivalent to specifying--- AttributesToGet without specifying any value for Select. If neither--- Select nor AttributesToGet are specified, DynamoDB defaults to--- ALL_ATTRIBUTES. You cannot use both AttributesToGet and Select together--- in a single request, unless the value for Select is SPECIFIC_ATTRIBUTES.--- (This usage is equivalent to specifying AttributesToGet without any value--- for Select.).+--+-- 'ALL_ATTRIBUTES' - Returns all of the item attributes.+--+-- 'COUNT' - Returns the number of matching items, rather than the matching+-- items themselves.+--+-- 'SPECIFIC_ATTRIBUTES' - Returns only the attributes listed in /AttributesToGet/. This return value is equivalent to specifying /AttributesToGet/ without+-- specifying any value for /Select/.+--+-- If neither /Select/ nor /AttributesToGet/ are specified, DynamoDB defaults to 'ALL_ATTRIBUTES'. You cannot use both /AttributesToGet/ and /Select/ together in a single+-- request, unless the value for /Select/ is 'SPECIFIC_ATTRIBUTES'. (This usage is+-- equivalent to specifying /AttributesToGet/ without any value for /Select/.) sSelect :: Lens' Scan (Maybe Select) sSelect = lens _sSelect (\s a -> s { _sSelect = a }) @@ -306,15 +371,16 @@ sTableName :: Lens' Scan Text sTableName = lens _sTableName (\s a -> s { _sTableName = a }) --- | For a parallel Scan request, TotalSegments represents the total number of--- segments into which the Scan operation will be divided. The value of--- TotalSegments corresponds to the number of application workers that will--- perform the parallel scan. For example, if you want to scan a table using--- four application threads, specify a TotalSegments value of 4. The value--- for TotalSegments must be greater than or equal to 1, and less than or--- equal to 1000000. If you specify a TotalSegments value of 1, the Scan--- operation will be sequential rather than parallel. If you specify--- TotalSegments, you must also specify Segment.+-- | For a parallel /Scan/ request, /TotalSegments/ represents the total number of+-- segments into which the /Scan/ operation will be divided. The value of /TotalSegments/ corresponds to the number of application workers that will perform the+-- parallel scan. For example, if you want to scan a table using four+-- application threads, specify a /TotalSegments/ value of 4.+--+-- The value for /TotalSegments/ must be greater than or equal to 1, and less+-- than or equal to 1000000. If you specify a /TotalSegments/ value of 1, the /Scan/+-- operation will be sequential rather than parallel.+--+-- If you specify /TotalSegments/, you must also specify /Segment/. sTotalSegments :: Lens' Scan (Maybe Natural) sTotalSegments = lens _sTotalSegments (\s a -> s { _sTotalSegments = a }) . mapping _Nat @@ -353,37 +419,40 @@ srConsumedCapacity = lens _srConsumedCapacity (\s a -> s { _srConsumedCapacity = a }) --- | The number of items in the response. If you set ScanFilter in the--- request, then Count is the number of items returned after the filter was--- applied, and ScannedCount is the number of matching items before the--- filter was applied. If you did not use a filter in the request, then--- Count is the same as ScannedCount.+-- | The number of items in the response.+--+-- If you set /ScanFilter/ in the request, then /Count/ is the number of items+-- returned after the filter was applied, and /ScannedCount/ is the number of+-- matching items before the filter was applied.+--+-- If you did not use a filter in the request, then /Count/ is the same as /ScannedCount/. srCount :: Lens' ScanResponse (Maybe Int) srCount = lens _srCount (\s a -> s { _srCount = a }) -- | An array of item attributes that match the scan criteria. Each element in--- this array consists of an attribute name and the value for that--- attribute.+-- this array consists of an attribute name and the value for that attribute. srItems :: Lens' ScanResponse [HashMap Text AttributeValue] srItems = lens _srItems (\s a -> s { _srItems = a }) . _List -- | The primary key of the item where the operation stopped, inclusive of the--- previous result set. Use this value to start a new operation, excluding--- this value in the new request. If LastEvaluatedKey is empty, then the--- "last page" of results has been processed and there is no more data to be--- retrieved. If LastEvaluatedKey is not empty, it does not necessarily mean--- that there is more data in the result set. The only way to know when you--- have reached the end of the result set is when LastEvaluatedKey is empty.+-- previous result set. Use this value to start a new operation, excluding this+-- value in the new request.+--+-- If /LastEvaluatedKey/ is empty, then the "last page" of results has been+-- processed and there is no more data to be retrieved.+--+-- If /LastEvaluatedKey/ is not empty, it does not necessarily mean that there is+-- more data in the result set. The only way to know when you have reached the+-- end of the result set is when /LastEvaluatedKey/ is empty. srLastEvaluatedKey :: Lens' ScanResponse (HashMap Text AttributeValue) srLastEvaluatedKey = lens _srLastEvaluatedKey (\s a -> s { _srLastEvaluatedKey = a }) . _Map --- | The number of items evaluated, before any ScanFilter is applied. A high--- ScannedCount value with few, or no, Count results indicates an--- inefficient Scan operation. For more information, see Count and--- ScannedCount in the Amazon DynamoDB Developer Guide. If you did not use a--- filter in the request, then ScannedCount is the same as Count.+-- | The number of items evaluated, before any /ScanFilter/ is applied. A high /ScannedCount/ value with few, or no, /Count/ results indicates an inefficient /Scan/+-- operation. For more information, see <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#Count Count and ScannedCount> in the /AmazonDynamoDB Developer Guide/.+--+-- If you did not use a filter in the request, then /ScannedCount/ is the same as /Count/. srScannedCount :: Lens' ScanResponse (Maybe Int) srScannedCount = lens _srScannedCount (\s a -> s { _srScannedCount = a })
gen/Network/AWS/DynamoDB/Types.hs view
@@ -279,1990 +279,2203 @@ , _wDeleteRequest = Nothing } --- | A request to perform a DeleteItem operation.-wDeleteRequest :: Lens' WriteRequest (Maybe DeleteRequest)-wDeleteRequest = lens _wDeleteRequest (\s a -> s { _wDeleteRequest = a })---- | A request to perform a PutItem operation.-wPutRequest :: Lens' WriteRequest (Maybe PutRequest)-wPutRequest = lens _wPutRequest (\s a -> s { _wPutRequest = a })--instance FromJSON WriteRequest where- parseJSON = withObject "WriteRequest" $ \o -> WriteRequest- <$> o .:? "DeleteRequest"- <*> o .:? "PutRequest"--instance ToJSON WriteRequest where- toJSON WriteRequest{..} = object- [ "PutRequest" .= _wPutRequest- , "DeleteRequest" .= _wDeleteRequest- ]--data ProvisionedThroughputDescription = ProvisionedThroughputDescription- { _ptdLastDecreaseDateTime :: Maybe RFC822- , _ptdLastIncreaseDateTime :: Maybe RFC822- , _ptdNumberOfDecreasesToday :: Maybe Nat- , _ptdReadCapacityUnits :: Maybe Nat- , _ptdWriteCapacityUnits :: Maybe Nat- } deriving (Eq, Ord, Show)---- | 'ProvisionedThroughputDescription' constructor.------ The fields accessible through corresponding lenses are:------ * 'ptdLastDecreaseDateTime' @::@ 'Maybe' 'UTCTime'------ * 'ptdLastIncreaseDateTime' @::@ 'Maybe' 'UTCTime'------ * 'ptdNumberOfDecreasesToday' @::@ 'Maybe' 'Natural'------ * 'ptdReadCapacityUnits' @::@ 'Maybe' 'Natural'------ * 'ptdWriteCapacityUnits' @::@ 'Maybe' 'Natural'----provisionedThroughputDescription :: ProvisionedThroughputDescription-provisionedThroughputDescription = ProvisionedThroughputDescription- { _ptdLastIncreaseDateTime = Nothing- , _ptdLastDecreaseDateTime = Nothing- , _ptdNumberOfDecreasesToday = Nothing- , _ptdReadCapacityUnits = Nothing- , _ptdWriteCapacityUnits = Nothing- }---- | The date and time of the last provisioned throughput decrease for this--- table.-ptdLastDecreaseDateTime :: Lens' ProvisionedThroughputDescription (Maybe UTCTime)-ptdLastDecreaseDateTime =- lens _ptdLastDecreaseDateTime (\s a -> s { _ptdLastDecreaseDateTime = a })- . mapping _Time---- | The date and time of the last provisioned throughput increase for this--- table.-ptdLastIncreaseDateTime :: Lens' ProvisionedThroughputDescription (Maybe UTCTime)-ptdLastIncreaseDateTime =- lens _ptdLastIncreaseDateTime (\s a -> s { _ptdLastIncreaseDateTime = a })- . mapping _Time---- | The number of provisioned throughput decreases for this table during this--- UTC calendar day. For current maximums on provisioned throughput--- decreases, see Limits in the Amazon DynamoDB Developer Guide.-ptdNumberOfDecreasesToday :: Lens' ProvisionedThroughputDescription (Maybe Natural)-ptdNumberOfDecreasesToday =- lens _ptdNumberOfDecreasesToday- (\s a -> s { _ptdNumberOfDecreasesToday = a })- . mapping _Nat---- | The maximum number of strongly consistent reads consumed per second--- before DynamoDB returns a ThrottlingException. Eventually consistent--- reads require less effort than strongly consistent reads, so a setting of--- 50 ReadCapacityUnits per second provides 100 eventually consistent--- ReadCapacityUnits per second.-ptdReadCapacityUnits :: Lens' ProvisionedThroughputDescription (Maybe Natural)-ptdReadCapacityUnits =- lens _ptdReadCapacityUnits (\s a -> s { _ptdReadCapacityUnits = a })- . mapping _Nat---- | The maximum number of writes consumed per second before DynamoDB returns--- a ThrottlingException.-ptdWriteCapacityUnits :: Lens' ProvisionedThroughputDescription (Maybe Natural)-ptdWriteCapacityUnits =- lens _ptdWriteCapacityUnits (\s a -> s { _ptdWriteCapacityUnits = a })- . mapping _Nat--instance FromJSON ProvisionedThroughputDescription where- parseJSON = withObject "ProvisionedThroughputDescription" $ \o -> ProvisionedThroughputDescription- <$> o .:? "LastDecreaseDateTime"- <*> o .:? "LastIncreaseDateTime"- <*> o .:? "NumberOfDecreasesToday"- <*> o .:? "ReadCapacityUnits"- <*> o .:? "WriteCapacityUnits"--instance ToJSON ProvisionedThroughputDescription where- toJSON ProvisionedThroughputDescription{..} = object- [ "LastIncreaseDateTime" .= _ptdLastIncreaseDateTime- , "LastDecreaseDateTime" .= _ptdLastDecreaseDateTime- , "NumberOfDecreasesToday" .= _ptdNumberOfDecreasesToday- , "ReadCapacityUnits" .= _ptdReadCapacityUnits- , "WriteCapacityUnits" .= _ptdWriteCapacityUnits- ]--data KeyType- = Hash -- ^ HASH- | Range -- ^ RANGE- deriving (Eq, Ord, Show, Generic, Enum)--instance Hashable KeyType--instance FromText KeyType where- parser = match "HASH" Hash- <|> match "RANGE" Range--instance ToText KeyType where- toText = \case- Hash -> "HASH"- Range -> "RANGE"--instance ToByteString KeyType-instance ToHeader KeyType-instance ToQuery KeyType--instance FromJSON KeyType where- parseJSON = parseJSONText "KeyType"--instance ToJSON KeyType where- toJSON = toJSONText--data AttributeValue = AttributeValue- { _avB :: Maybe Base64- , _avBOOL :: Maybe Bool- , _avBS :: List "BS" Base64- , _avL :: List "L" AttributeValue- , _avM :: Map Text AttributeValue- , _avN :: Maybe Text- , _avNS :: List "NS" Text- , _avNULL :: Maybe Bool- , _avS :: Maybe Text- , _avSS :: List "SS" Text- } deriving (Eq, Show)---- | 'AttributeValue' constructor.------ The fields accessible through corresponding lenses are:------ * 'avB' @::@ 'Maybe' 'Base64'------ * 'avBOOL' @::@ 'Maybe' 'Bool'------ * 'avBS' @::@ ['Base64']------ * 'avL' @::@ ['AttributeValue']------ * 'avM' @::@ 'HashMap' 'Text' 'AttributeValue'------ * 'avN' @::@ 'Maybe' 'Text'------ * 'avNS' @::@ ['Text']------ * 'avNULL' @::@ 'Maybe' 'Bool'------ * 'avS' @::@ 'Maybe' 'Text'------ * 'avSS' @::@ ['Text']----attributeValue :: AttributeValue-attributeValue = AttributeValue- { _avS = Nothing- , _avN = Nothing- , _avB = Nothing- , _avSS = mempty- , _avNS = mempty- , _avBS = mempty- , _avM = mempty- , _avL = mempty- , _avNULL = Nothing- , _avBOOL = Nothing- }---- | A Binary data type.-avB :: Lens' AttributeValue (Maybe Base64)-avB = lens _avB (\s a -> s { _avB = a })---- | A Boolean data type.-avBOOL :: Lens' AttributeValue (Maybe Bool)-avBOOL = lens _avBOOL (\s a -> s { _avBOOL = a })---- | A Binary Set data type.-avBS :: Lens' AttributeValue [Base64]-avBS = lens _avBS (\s a -> s { _avBS = a }) . _List---- | A List of attribute values.-avL :: Lens' AttributeValue [AttributeValue]-avL = lens _avL (\s a -> s { _avL = a }) . _List---- | A Map of attribute values.-avM :: Lens' AttributeValue (HashMap Text AttributeValue)-avM = lens _avM (\s a -> s { _avM = a }) . _Map---- | A Number data type.-avN :: Lens' AttributeValue (Maybe Text)-avN = lens _avN (\s a -> s { _avN = a })---- | A Number Set data type.-avNS :: Lens' AttributeValue [Text]-avNS = lens _avNS (\s a -> s { _avNS = a }) . _List---- | A Null data type.-avNULL :: Lens' AttributeValue (Maybe Bool)-avNULL = lens _avNULL (\s a -> s { _avNULL = a })---- | A String data type.-avS :: Lens' AttributeValue (Maybe Text)-avS = lens _avS (\s a -> s { _avS = a })---- | A String Set data type.-avSS :: Lens' AttributeValue [Text]-avSS = lens _avSS (\s a -> s { _avSS = a }) . _List--instance FromJSON AttributeValue where- parseJSON = withObject "AttributeValue" $ \o -> AttributeValue- <$> o .:? "B"- <*> o .:? "BOOL"- <*> o .: "BS"- <*> o .: "L"- <*> o .: "M"- <*> o .:? "N"- <*> o .: "NS"- <*> o .:? "NULL"- <*> o .:? "S"- <*> o .: "SS"--instance ToJSON AttributeValue where- toJSON AttributeValue{..} = object- [ "S" .= _avS- , "N" .= _avN- , "B" .= _avB- , "SS" .= _avSS- , "NS" .= _avNS- , "BS" .= _avBS- , "M" .= _avM- , "L" .= _avL- , "NULL" .= _avNULL- , "BOOL" .= _avBOOL- ]--data IndexStatus- = Active -- ^ ACTIVE- | Creating -- ^ CREATING- | Deleting -- ^ DELETING- | Updating -- ^ UPDATING- deriving (Eq, Ord, Show, Generic, Enum)--instance Hashable IndexStatus--instance FromText IndexStatus where- parser = match "ACTIVE" Active- <|> match "CREATING" Creating- <|> match "DELETING" Deleting- <|> match "UPDATING" Updating--instance ToText IndexStatus where- toText = \case- Active -> "ACTIVE"- Creating -> "CREATING"- Deleting -> "DELETING"- Updating -> "UPDATING"--instance ToByteString IndexStatus-instance ToHeader IndexStatus-instance ToQuery IndexStatus--instance FromJSON IndexStatus where- parseJSON = parseJSONText "IndexStatus"--instance ToJSON IndexStatus where- toJSON = toJSONText--data ProvisionedThroughput = ProvisionedThroughput- { _ptReadCapacityUnits :: Nat- , _ptWriteCapacityUnits :: Nat- } deriving (Eq, Ord, Show)---- | 'ProvisionedThroughput' constructor.------ The fields accessible through corresponding lenses are:------ * 'ptReadCapacityUnits' @::@ 'Natural'------ * 'ptWriteCapacityUnits' @::@ 'Natural'----provisionedThroughput :: Natural -- ^ 'ptReadCapacityUnits'- -> Natural -- ^ 'ptWriteCapacityUnits'- -> ProvisionedThroughput-provisionedThroughput p1 p2 = ProvisionedThroughput- { _ptReadCapacityUnits = withIso _Nat (const id) p1- , _ptWriteCapacityUnits = withIso _Nat (const id) p2- }---- | The maximum number of strongly consistent reads consumed per second--- before DynamoDB returns a ThrottlingException. For more information, see--- Specifying Read and Write Requirements in the Amazon DynamoDB Developer--- Guide.-ptReadCapacityUnits :: Lens' ProvisionedThroughput Natural-ptReadCapacityUnits =- lens _ptReadCapacityUnits (\s a -> s { _ptReadCapacityUnits = a })- . _Nat---- | The maximum number of writes consumed per second before DynamoDB returns--- a ThrottlingException. For more information, see Specifying Read and--- Write Requirements in the Amazon DynamoDB Developer Guide.-ptWriteCapacityUnits :: Lens' ProvisionedThroughput Natural-ptWriteCapacityUnits =- lens _ptWriteCapacityUnits (\s a -> s { _ptWriteCapacityUnits = a })- . _Nat--instance FromJSON ProvisionedThroughput where- parseJSON = withObject "ProvisionedThroughput" $ \o -> ProvisionedThroughput- <$> o .: "ReadCapacityUnits"- <*> o .: "WriteCapacityUnits"--instance ToJSON ProvisionedThroughput where- toJSON ProvisionedThroughput{..} = object- [ "ReadCapacityUnits" .= _ptReadCapacityUnits- , "WriteCapacityUnits" .= _ptWriteCapacityUnits- ]--data TableStatus- = TSActive -- ^ ACTIVE- | TSCreating -- ^ CREATING- | TSDeleting -- ^ DELETING- | TSUpdating -- ^ UPDATING- deriving (Eq, Ord, Show, Generic, Enum)--instance Hashable TableStatus--instance FromText TableStatus where- parser = match "ACTIVE" TSActive- <|> match "CREATING" TSCreating- <|> match "DELETING" TSDeleting- <|> match "UPDATING" TSUpdating--instance ToText TableStatus where- toText = \case- TSActive -> "ACTIVE"- TSCreating -> "CREATING"- TSDeleting -> "DELETING"- TSUpdating -> "UPDATING"--instance ToByteString TableStatus-instance ToHeader TableStatus-instance ToQuery TableStatus--instance FromJSON TableStatus where- parseJSON = parseJSONText "TableStatus"--instance ToJSON TableStatus where- toJSON = toJSONText--data ProjectionType- = All -- ^ ALL- | Include -- ^ INCLUDE- | KeysOnly -- ^ KEYS_ONLY- deriving (Eq, Ord, Show, Generic, Enum)--instance Hashable ProjectionType--instance FromText ProjectionType where- parser = match "ALL" All- <|> match "INCLUDE" Include- <|> match "KEYS_ONLY" KeysOnly--instance ToText ProjectionType where- toText = \case- All -> "ALL"- Include -> "INCLUDE"- KeysOnly -> "KEYS_ONLY"--instance ToByteString ProjectionType-instance ToHeader ProjectionType-instance ToQuery ProjectionType--instance FromJSON ProjectionType where- parseJSON = parseJSONText "ProjectionType"--instance ToJSON ProjectionType where- toJSON = toJSONText--data TableDescription = TableDescription- { _tdAttributeDefinitions :: List "AttributeDefinitions" AttributeDefinition- , _tdCreationDateTime :: Maybe RFC822- , _tdGlobalSecondaryIndexes :: List "GlobalSecondaryIndexes" GlobalSecondaryIndexDescription- , _tdItemCount :: Maybe Integer- , _tdKeySchema :: List1 "KeySchema" KeySchemaElement- , _tdLocalSecondaryIndexes :: List "LocalSecondaryIndexes" LocalSecondaryIndexDescription- , _tdProvisionedThroughput :: Maybe ProvisionedThroughputDescription- , _tdTableName :: Maybe Text- , _tdTableSizeBytes :: Maybe Integer- , _tdTableStatus :: Maybe TableStatus- } deriving (Eq, Show)---- | 'TableDescription' constructor.------ The fields accessible through corresponding lenses are:------ * 'tdAttributeDefinitions' @::@ ['AttributeDefinition']------ * 'tdCreationDateTime' @::@ 'Maybe' 'UTCTime'------ * 'tdGlobalSecondaryIndexes' @::@ ['GlobalSecondaryIndexDescription']------ * 'tdItemCount' @::@ 'Maybe' 'Integer'------ * 'tdKeySchema' @::@ 'NonEmpty' 'KeySchemaElement'------ * 'tdLocalSecondaryIndexes' @::@ ['LocalSecondaryIndexDescription']------ * 'tdProvisionedThroughput' @::@ 'Maybe' 'ProvisionedThroughputDescription'------ * 'tdTableName' @::@ 'Maybe' 'Text'------ * 'tdTableSizeBytes' @::@ 'Maybe' 'Integer'------ * 'tdTableStatus' @::@ 'Maybe' 'TableStatus'----tableDescription :: NonEmpty KeySchemaElement -- ^ 'tdKeySchema'- -> TableDescription-tableDescription p1 = TableDescription- { _tdKeySchema = withIso _List1 (const id) p1- , _tdAttributeDefinitions = mempty- , _tdTableName = Nothing- , _tdTableStatus = Nothing- , _tdCreationDateTime = Nothing- , _tdProvisionedThroughput = Nothing- , _tdTableSizeBytes = Nothing- , _tdItemCount = Nothing- , _tdLocalSecondaryIndexes = mempty- , _tdGlobalSecondaryIndexes = mempty- }---- | An array of AttributeDefinition objects. Each of these objects describes--- one attribute in the table and index key schema. Each AttributeDefinition--- object in this array is composed of: AttributeName - The name of the--- attribute. AttributeType - The data type for the attribute.-tdAttributeDefinitions :: Lens' TableDescription [AttributeDefinition]-tdAttributeDefinitions =- lens _tdAttributeDefinitions (\s a -> s { _tdAttributeDefinitions = a })- . _List---- | The date and time when the table was created, in UNIX epoch time format.-tdCreationDateTime :: Lens' TableDescription (Maybe UTCTime)-tdCreationDateTime =- lens _tdCreationDateTime (\s a -> s { _tdCreationDateTime = a })- . mapping _Time---- | The global secondary indexes, if any, on the table. Each index is scoped--- to a given hash key value. Each element is composed of: IndexName - The--- name of the global secondary index. IndexSizeBytes - The total size of--- the global secondary index, in bytes. DynamoDB updates this value--- approximately every six hours. Recent changes might not be reflected in--- this value. IndexStatus - The current status of the global secondary--- index: CREATING - The index is being created. UPDATING - The index is--- being updated. DELETING - The index is being deleted. ACTIVE - The index--- is ready for use. ItemCount - The number of items in the global secondary--- index. DynamoDB updates this value approximately every six hours. Recent--- changes might not be reflected in this value. KeySchema - Specifies the--- complete index key schema. The attribute names in the key schema must be--- between 1 and 255 characters (inclusive). The key schema must begin with--- the same hash key attribute as the table. Projection - Specifies--- attributes that are copied (projected) from the table into the index.--- These are in addition to the primary key attributes and index key--- attributes, which are automatically projected. Each attribute--- specification is composed of: ProjectionType - One of the following:--- KEYS_ONLY - Only the index and primary keys are projected into the index.--- INCLUDE - Only the specified table attributes are projected into the--- index. The list of projected attributes are in NonKeyAttributes. ALL ---- All of the table attributes are projected into the index.--- NonKeyAttributes - A list of one or more non-key attribute names that are--- projected into the secondary index. The total count of attributes--- specified in NonKeyAttributes, summed across all of the secondary--- indexes, must not exceed 20. If you project the same attribute into two--- different indexes, this counts as two distinct attributes when--- determining the total. ProvisionedThroughput - The provisioned throughput--- settings for the global secondary index, consisting of read and write--- capacity units, along with data about increases and decreases. If the--- table is in the DELETING state, no information about indexes will be--- returned.-tdGlobalSecondaryIndexes :: Lens' TableDescription [GlobalSecondaryIndexDescription]-tdGlobalSecondaryIndexes =- lens _tdGlobalSecondaryIndexes- (\s a -> s { _tdGlobalSecondaryIndexes = a })- . _List---- | The number of items in the specified table. DynamoDB updates this value--- approximately every six hours. Recent changes might not be reflected in--- this value.-tdItemCount :: Lens' TableDescription (Maybe Integer)-tdItemCount = lens _tdItemCount (\s a -> s { _tdItemCount = a })---- | The primary key structure for the table. Each KeySchemaElement consists--- of: AttributeName - The name of the attribute. KeyType - The key type for--- the attribute. Can be either HASH or RANGE. For more information about--- primary keys, see Primary Key in the Amazon DynamoDB Developer Guide.-tdKeySchema :: Lens' TableDescription (NonEmpty KeySchemaElement)-tdKeySchema = lens _tdKeySchema (\s a -> s { _tdKeySchema = a }) . _List1---- | Represents one or more local secondary indexes on the table. Each index--- is scoped to a given hash key value. Tables with one or more local--- secondary indexes are subject to an item collection size limit, where the--- amount of data within a given item collection cannot exceed 10 GB. Each--- element is composed of: IndexName - The name of the local secondary--- index. KeySchema - Specifies the complete index key schema. The attribute--- names in the key schema must be between 1 and 255 characters (inclusive).--- The key schema must begin with the same hash key attribute as the table.--- Projection - Specifies attributes that are copied (projected) from the--- table into the index. These are in addition to the primary key attributes--- and index key attributes, which are automatically projected. Each--- attribute specification is composed of: ProjectionType - One of the--- following: KEYS_ONLY - Only the index and primary keys are projected into--- the index. INCLUDE - Only the specified table attributes are projected--- into the index. The list of projected attributes are in NonKeyAttributes.--- ALL - All of the table attributes are projected into the index.--- NonKeyAttributes - A list of one or more non-key attribute names that are--- projected into the secondary index. The total count of attributes--- specified in NonKeyAttributes, summed across all of the secondary--- indexes, must not exceed 20. If you project the same attribute into two--- different indexes, this counts as two distinct attributes when--- determining the total. IndexSizeBytes - Represents the total size of the--- index, in bytes. DynamoDB updates this value approximately every six--- hours. Recent changes might not be reflected in this value. ItemCount ---- Represents the number of items in the index. DynamoDB updates this value--- approximately every six hours. Recent changes might not be reflected in--- this value. If the table is in the DELETING state, no information about--- indexes will be returned.-tdLocalSecondaryIndexes :: Lens' TableDescription [LocalSecondaryIndexDescription]-tdLocalSecondaryIndexes =- lens _tdLocalSecondaryIndexes (\s a -> s { _tdLocalSecondaryIndexes = a })- . _List---- | The provisioned throughput settings for the table, consisting of read and--- write capacity units, along with data about increases and decreases.-tdProvisionedThroughput :: Lens' TableDescription (Maybe ProvisionedThroughputDescription)-tdProvisionedThroughput =- lens _tdProvisionedThroughput (\s a -> s { _tdProvisionedThroughput = a })---- | The name of the table.-tdTableName :: Lens' TableDescription (Maybe Text)-tdTableName = lens _tdTableName (\s a -> s { _tdTableName = a })---- | The total size of the specified table, in bytes. DynamoDB updates this--- value approximately every six hours. Recent changes might not be--- reflected in this value.-tdTableSizeBytes :: Lens' TableDescription (Maybe Integer)-tdTableSizeBytes = lens _tdTableSizeBytes (\s a -> s { _tdTableSizeBytes = a })---- | The current state of the table: CREATING - The table is being created, as--- the result of a CreateTable operation. UPDATING - The table is being--- updated, as the result of an UpdateTable operation. DELETING - The table--- is being deleted, as the result of a DeleteTable operation. ACTIVE - The--- table is ready for use.-tdTableStatus :: Lens' TableDescription (Maybe TableStatus)-tdTableStatus = lens _tdTableStatus (\s a -> s { _tdTableStatus = a })--instance FromJSON TableDescription where- parseJSON = withObject "TableDescription" $ \o -> TableDescription- <$> o .: "AttributeDefinitions"- <*> o .:? "CreationDateTime"- <*> o .: "GlobalSecondaryIndexes"- <*> o .:? "ItemCount"- <*> o .: "KeySchema"- <*> o .: "LocalSecondaryIndexes"- <*> o .:? "ProvisionedThroughput"- <*> o .:? "TableName"- <*> o .:? "TableSizeBytes"- <*> o .:? "TableStatus"--instance ToJSON TableDescription where- toJSON TableDescription{..} = object- [ "AttributeDefinitions" .= _tdAttributeDefinitions- , "TableName" .= _tdTableName- , "KeySchema" .= _tdKeySchema- , "TableStatus" .= _tdTableStatus- , "CreationDateTime" .= _tdCreationDateTime- , "ProvisionedThroughput" .= _tdProvisionedThroughput- , "TableSizeBytes" .= _tdTableSizeBytes- , "ItemCount" .= _tdItemCount- , "LocalSecondaryIndexes" .= _tdLocalSecondaryIndexes- , "GlobalSecondaryIndexes" .= _tdGlobalSecondaryIndexes- ]--data KeysAndAttributes = KeysAndAttributes- { _kaaAttributesToGet :: List1 "AttributesToGet" Text- , _kaaConsistentRead :: Maybe Bool- , _kaaExpressionAttributeNames :: Map Text Text- , _kaaKeys :: List1 "Keys" (Map Text AttributeValue)- , _kaaProjectionExpression :: Maybe Text- } deriving (Eq, Show)---- | 'KeysAndAttributes' constructor.------ The fields accessible through corresponding lenses are:------ * 'kaaAttributesToGet' @::@ 'NonEmpty' 'Text'------ * 'kaaConsistentRead' @::@ 'Maybe' 'Bool'------ * 'kaaExpressionAttributeNames' @::@ 'HashMap' 'Text' 'Text'------ * 'kaaKeys' @::@ 'NonEmpty' ('HashMap' 'Text' 'AttributeValue')------ * 'kaaProjectionExpression' @::@ 'Maybe' 'Text'----keysAndAttributes :: NonEmpty (HashMap Text AttributeValue) -- ^ 'kaaKeys'- -> NonEmpty Text -- ^ 'kaaAttributesToGet'- -> KeysAndAttributes-keysAndAttributes p1 p2 = KeysAndAttributes- { _kaaKeys = withIso _List1 (const id) p1- , _kaaAttributesToGet = withIso _List1 (const id) p2- , _kaaConsistentRead = Nothing- , _kaaProjectionExpression = Nothing- , _kaaExpressionAttributeNames = mempty- }---- | One or more attributes to retrieve from the table or index. If no--- attribute names are specified then all attributes will be returned. If--- any of the specified attributes are not found, they will not appear in--- the result.-kaaAttributesToGet :: Lens' KeysAndAttributes (NonEmpty Text)-kaaAttributesToGet =- lens _kaaAttributesToGet (\s a -> s { _kaaAttributesToGet = a })- . _List1---- | The consistency of a read operation. If set to true, then a strongly--- consistent read is used; otherwise, an eventually consistent read is--- used.-kaaConsistentRead :: Lens' KeysAndAttributes (Maybe Bool)-kaaConsistentRead =- 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: To--- shorten an attribute name that is very long or unwieldy in an expression.--- To create a placeholder for repeating occurrences of an attribute name in--- an expression. To prevent special characters in an attribute name from--- being misinterpreted in an expression. Use the # character in an--- expression to dereference an attribute name. For example, consider the--- following expression: order.customerInfo.LastName = "Smith" OR--- order.customerInfo.LastName = "Jones" Now suppose that you specified the--- following for ExpressionAttributeNames:--- {"n":"order.customerInfo.LastName"} The expression can now be simplified--- as follows: #n = "Smith" OR #n = "Jones".-kaaExpressionAttributeNames :: Lens' KeysAndAttributes (HashMap Text Text)-kaaExpressionAttributeNames =- lens _kaaExpressionAttributeNames- (\s a -> s { _kaaExpressionAttributeNames = a })- . _Map---- | The primary key attribute values that define the items and the attributes--- associated with the items.-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. 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.-kaaProjectionExpression :: Lens' KeysAndAttributes (Maybe Text)-kaaProjectionExpression =- lens _kaaProjectionExpression (\s a -> s { _kaaProjectionExpression = a })--instance FromJSON KeysAndAttributes where- parseJSON = withObject "KeysAndAttributes" $ \o -> KeysAndAttributes- <$> o .: "AttributesToGet"- <*> o .:? "ConsistentRead"- <*> o .: "ExpressionAttributeNames"- <*> o .: "Keys"- <*> o .:? "ProjectionExpression"--instance ToJSON KeysAndAttributes where- toJSON KeysAndAttributes{..} = object- [ "Keys" .= _kaaKeys- , "AttributesToGet" .= _kaaAttributesToGet- , "ConsistentRead" .= _kaaConsistentRead- , "ProjectionExpression" .= _kaaProjectionExpression- , "ExpressionAttributeNames" .= _kaaExpressionAttributeNames- ]--data ReturnConsumedCapacity- = Indexes -- ^ INDEXES- | None -- ^ NONE- | Total -- ^ TOTAL- deriving (Eq, Ord, Show, Generic, Enum)--instance Hashable ReturnConsumedCapacity--instance FromText ReturnConsumedCapacity where- parser = match "INDEXES" Indexes- <|> match "NONE" None- <|> match "TOTAL" Total--instance ToText ReturnConsumedCapacity where- toText = \case- Indexes -> "INDEXES"- None -> "NONE"- Total -> "TOTAL"--instance ToByteString ReturnConsumedCapacity-instance ToHeader ReturnConsumedCapacity-instance ToQuery ReturnConsumedCapacity--instance FromJSON ReturnConsumedCapacity where- parseJSON = parseJSONText "ReturnConsumedCapacity"--instance ToJSON ReturnConsumedCapacity where- toJSON = toJSONText--data ReturnItemCollectionMetrics- = RICMNone -- ^ NONE- | RICMSize -- ^ SIZE- deriving (Eq, Ord, Show, Generic, Enum)--instance Hashable ReturnItemCollectionMetrics--instance FromText ReturnItemCollectionMetrics where- parser = match "NONE" RICMNone- <|> match "SIZE" RICMSize--instance ToText ReturnItemCollectionMetrics where- toText = \case- RICMNone -> "NONE"- RICMSize -> "SIZE"--instance ToByteString ReturnItemCollectionMetrics-instance ToHeader ReturnItemCollectionMetrics-instance ToQuery ReturnItemCollectionMetrics--instance FromJSON ReturnItemCollectionMetrics where- parseJSON = parseJSONText "ReturnItemCollectionMetrics"--instance ToJSON ReturnItemCollectionMetrics where- toJSON = toJSONText--data AttributeValueUpdate = AttributeValueUpdate- { _avuAction :: Maybe AttributeAction- , _avuValue :: Maybe AttributeValue- } deriving (Eq, Show)---- | 'AttributeValueUpdate' constructor.------ The fields accessible through corresponding lenses are:------ * 'avuAction' @::@ 'Maybe' 'AttributeAction'------ * 'avuValue' @::@ 'Maybe' 'AttributeValue'----attributeValueUpdate :: AttributeValueUpdate-attributeValueUpdate = AttributeValueUpdate- { _avuValue = Nothing- , _avuAction = Nothing- }---- | Specifies how to perform the update. Valid values are PUT (default),--- DELETE, and ADD. The behavior depends on whether the specified primary--- key already exists in the table. If an item with the specified Key is--- found in the table: PUT - Adds the specified attribute to the item. If--- the attribute already exists, it is replaced by the new value. DELETE ---- If no value is specified, the attribute and its value are removed from--- the item. The data type of the specified value must match the existing--- value's data type. If a set of values is specified, then those values are--- subtracted from the old set. For example, if the attribute value was the--- set [a,b,c] and the DELETE action specified [a,c], then the final--- attribute value would be [b]. Specifying an empty set is an error. ADD ---- If the attribute does not already exist, then the attribute and its--- values are added to the item. If the attribute does exist, then the--- behavior of ADD depends on the data type of the attribute: If the--- existing attribute is a number, and if Value is also a number, then the--- Value is mathematically added to the existing attribute. If Value is a--- negative number, then it is subtracted from the existing attribute. 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 ADD action specified [3], then the final attribute value--- would be [1,2,3]. An error occurs if an Add action is specified for a set--- attribute and the attribute type specified does not match the existing--- set type. Both sets must have the same primitive data type. For example,--- if the existing data type is a set of strings, the Value must also be a--- set of strings. The same holds true for number sets and binary sets. This--- action is only valid for an existing attribute whose data type is number--- or is a set. Do not use ADD for any other data types. If no item with the--- specified Key is found: PUT - DynamoDB creates a new item with the--- specified primary key, and then adds the attribute. DELETE - Nothing--- happens; there is no attribute to delete. ADD - DynamoDB creates 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;--- no other data types can be specified.-avuAction :: Lens' AttributeValueUpdate (Maybe AttributeAction)-avuAction = lens _avuAction (\s a -> s { _avuAction = a })--avuValue :: Lens' AttributeValueUpdate (Maybe AttributeValue)-avuValue = lens _avuValue (\s a -> s { _avuValue = a })--instance FromJSON AttributeValueUpdate where- parseJSON = withObject "AttributeValueUpdate" $ \o -> AttributeValueUpdate- <$> o .:? "Action"- <*> o .:? "Value"--instance ToJSON AttributeValueUpdate where- toJSON AttributeValueUpdate{..} = object- [ "Value" .= _avuValue- , "Action" .= _avuAction- ]--data ExpectedAttributeValue = ExpectedAttributeValue- { _eavAttributeValueList :: List "AttributeValueList" AttributeValue- , _eavComparisonOperator :: Maybe ComparisonOperator- , _eavExists :: Maybe Bool- , _eavValue :: Maybe AttributeValue- } deriving (Eq, Show)---- | 'ExpectedAttributeValue' constructor.------ The fields accessible through corresponding lenses are:------ * 'eavAttributeValueList' @::@ ['AttributeValue']------ * 'eavComparisonOperator' @::@ 'Maybe' 'ComparisonOperator'------ * 'eavExists' @::@ 'Maybe' 'Bool'------ * 'eavValue' @::@ 'Maybe' 'AttributeValue'----expectedAttributeValue :: ExpectedAttributeValue-expectedAttributeValue = ExpectedAttributeValue- { _eavValue = Nothing- , _eavExists = Nothing- , _eavComparisonOperator = Nothing- , _eavAttributeValueList = mempty- }---- | One or more values to evaluate against the supplied attribute. The number--- of values in the list depends on the ComparisonOperator being used. 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 greater than B. For a--- list of code values, see--- http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters. For--- Binary, DynamoDB treats each byte of the binary data as unsigned when it--- compares binary values, for example when evaluating query expressions.--- For information on specifying data types in JSON, see JSON Data Format in--- the Amazon DynamoDB Developer Guide.-eavAttributeValueList :: Lens' ExpectedAttributeValue [AttributeValue]-eavAttributeValueList =- lens _eavAttributeValueList (\s a -> s { _eavAttributeValueList = a })- . _List---- | A comparator for evaluating attributes in the AttributeValueList. For--- example, equals, greater than, less than, etc. The following comparison--- operators are available: EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL |--- CONTAINS | NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN The following are--- descriptions of each comparison operator. EQ : Equal. EQ is supported for--- all datatypes, including lists and maps. AttributeValueList can contain--- only one AttributeValue element of type String, Number, Binary, String--- Set, Number Set, or Binary Set. If an item contains an AttributeValue--- element of a different type than the one specified in the request, the--- value does not match. For example, {"S":"6"} does not equal {"N":"6"}.--- Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}. NE : Not equal. NE--- is supported for all datatypes, including lists and maps.--- AttributeValueList can contain only one AttributeValue of type String,--- Number, Binary, String Set, Number Set, or Binary Set. If an item--- contains an AttributeValue of a different type than the one specified in--- the request, the value does not match. For example, {"S":"6"} does not--- equal {"N":"6"}. Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}.--- LE : Less than or equal. AttributeValueList can contain only one--- AttributeValue element of type String, Number, or Binary (not a set--- type). If an item contains an AttributeValue element of a different type--- than the one specified in the request, the value does not match. For--- example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not--- compare to {"NS":["6", "2", "1"]}. LT : Less than. AttributeValueList can--- contain only one AttributeValue of type String, Number, or Binary (not a--- set type). If an item contains an AttributeValue element of a different--- type than the one specified in the request, the value does not match. For--- example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not--- compare to {"NS":["6", "2", "1"]}. GE : Greater than or equal.--- AttributeValueList can contain only one AttributeValue element of type--- String, Number, or Binary (not a set type). If an item contains an--- AttributeValue element of a different type than the one specified in the--- request, the value does not match. For example, {"S":"6"} does not equal--- {"N":"6"}. Also, {"N":"6"} does not compare to {"NS":["6", "2", "1"]}. GT--- : Greater than. AttributeValueList can contain only one AttributeValue--- element of type String, Number, or Binary (not a set type). If an item--- contains an AttributeValue element of a different type than the one--- specified in the request, the value does not match. For example,--- {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not compare to--- {"NS":["6", "2", "1"]}. NOT_NULL : The attribute exists. NOT_NULL is--- supported for all datatypes, including lists and maps. NULL : The--- attribute does not exist. NULL is supported for all datatypes, including--- lists and maps. CONTAINS : Checks for a subsequence, or value in a set.--- AttributeValueList can contain only one AttributeValue element of type--- String, Number, or Binary (not a set type). If the target attribute of--- the comparison is of type String, then the operator checks for a--- substring match. If the target attribute of the comparison is of type--- Binary, then the operator looks for a subsequence of the target that--- matches the input. If the target attribute of the comparison is a set--- ("SS", "NS", or "BS"), then the operator evaluates to true if it finds an--- exact match with any member of the set. CONTAINS is supported for lists:--- When evaluating "a CONTAINS b", "a" can be a list; however, "b" cannot be--- a set, a map, or a list. NOT_CONTAINS : Checks for absence of a--- subsequence, or absence of a value in a set. AttributeValueList can--- contain only one AttributeValue element of type String, Number, or Binary--- (not a set type). If the target attribute of the comparison is a String,--- then the operator checks for the absence of a substring match. If the--- target attribute of the comparison is Binary, then the operator checks--- for the absence of a subsequence of the target that matches the input. If--- the target attribute of the comparison is a set ("SS", "NS", or "BS"),--- then the operator evaluates to true if it does not find an exact match--- with any member of the set. NOT_CONTAINS is supported for lists: When--- evaluating "a NOT CONTAINS b", "a" can be a list; however, "b" cannot be--- a set, a map, or a list. BEGINS_WITH : Checks for a prefix.--- AttributeValueList can contain only one AttributeValue of type String or--- Binary (not a Number or a set type). The target attribute of the--- comparison must be of type String or Binary (not a Number or a set type).--- IN : Checks for matching elements within two sets. AttributeValueList can--- contain one or more AttributeValue elements of type String, Number, or--- Binary (not a set type). These attributes are compared against an--- existing set type attribute of an item. If any elements of the input set--- are present in the item attribute, the expression evaluates to true.--- BETWEEN : Greater than or equal to the first value, and less than or--- equal to the second value. AttributeValueList must contain two--- AttributeValue elements of the same type, either String, Number, or--- Binary (not a set type). A target attribute matches if the target value--- is greater than, or equal to, the first element and less than, or equal--- to, the second element. If an item contains an AttributeValue element of--- a different type than the one specified in the request, the value does--- not match. For example, {"S":"6"} does not compare to {"N":"6"}. Also,--- {"N":"6"} does not compare to {"NS":["6", "2", "1"]}.-eavComparisonOperator :: Lens' ExpectedAttributeValue (Maybe ComparisonOperator)-eavComparisonOperator =- lens _eavComparisonOperator (\s a -> s { _eavComparisonOperator = a })---- | Causes DynamoDB to evaluate the value before attempting a conditional--- operation: If Exists is true, DynamoDB will check to see if that--- attribute value already exists in the table. If it is found, then the--- operation succeeds. If it is not found, the operation fails with a--- ConditionalCheckFailedException. If Exists is false, DynamoDB assumes--- that the attribute value does not exist in the table. If in fact the--- value does not exist, then the assumption is valid and the operation--- succeeds. If the value is found, despite the assumption that it does not--- exist, the operation fails with a ConditionalCheckFailedException. The--- default setting for Exists is true. If you supply a Value all by itself,--- DynamoDB assumes the attribute exists: You don't have to set Exists to--- true, because it is implied. DynamoDB returns a ValidationException if:--- Exists is true but there is no Value to check. (You expect a value to--- exist, but don't specify what that value is.) Exists is false but you--- also specify a Value. (You cannot expect an attribute to have a value,--- while also expecting it not to exist.).-eavExists :: Lens' ExpectedAttributeValue (Maybe Bool)-eavExists = lens _eavExists (\s a -> s { _eavExists = a })--eavValue :: Lens' ExpectedAttributeValue (Maybe AttributeValue)-eavValue = lens _eavValue (\s a -> s { _eavValue = a })--instance FromJSON ExpectedAttributeValue where- parseJSON = withObject "ExpectedAttributeValue" $ \o -> ExpectedAttributeValue- <$> o .: "AttributeValueList"- <*> o .:? "ComparisonOperator"- <*> o .:? "Exists"- <*> o .:? "Value"--instance ToJSON ExpectedAttributeValue where- toJSON ExpectedAttributeValue{..} = object- [ "Value" .= _eavValue- , "Exists" .= _eavExists- , "ComparisonOperator" .= _eavComparisonOperator- , "AttributeValueList" .= _eavAttributeValueList- ]--data AttributeDefinition = AttributeDefinition- { _adAttributeName :: Text- , _adAttributeType :: ScalarAttributeType- } deriving (Eq, Show)---- | 'AttributeDefinition' constructor.------ The fields accessible through corresponding lenses are:------ * 'adAttributeName' @::@ 'Text'------ * 'adAttributeType' @::@ 'ScalarAttributeType'----attributeDefinition :: Text -- ^ 'adAttributeName'- -> ScalarAttributeType -- ^ 'adAttributeType'- -> AttributeDefinition-attributeDefinition p1 p2 = AttributeDefinition- { _adAttributeName = p1- , _adAttributeType = p2- }---- | A name for the attribute.-adAttributeName :: Lens' AttributeDefinition Text-adAttributeName = lens _adAttributeName (\s a -> s { _adAttributeName = a })---- | The data type for the attribute.-adAttributeType :: Lens' AttributeDefinition ScalarAttributeType-adAttributeType = lens _adAttributeType (\s a -> s { _adAttributeType = a })--instance FromJSON AttributeDefinition where- parseJSON = withObject "AttributeDefinition" $ \o -> AttributeDefinition- <$> o .: "AttributeName"- <*> o .: "AttributeType"--instance ToJSON AttributeDefinition where- toJSON AttributeDefinition{..} = object- [ "AttributeName" .= _adAttributeName- , "AttributeType" .= _adAttributeType- ]--data ComparisonOperator- = BeginsWith -- ^ BEGINS_WITH- | Between -- ^ BETWEEN- | Contains -- ^ CONTAINS- | Eq -- ^ EQ- | Ge -- ^ GE- | Gt -- ^ GT- | In' -- ^ IN- | Le -- ^ LE- | Lt -- ^ LT- | Ne -- ^ NE- | NotContains -- ^ NOT_CONTAINS- | NotNull -- ^ NOT_NULL- | Null -- ^ NULL- deriving (Eq, Ord, Show, Generic, Enum)--instance Hashable ComparisonOperator--instance FromText ComparisonOperator where- parser = match "BEGINS_WITH" BeginsWith- <|> match "BETWEEN" Between- <|> match "CONTAINS" Contains- <|> match "EQ" Eq- <|> match "GE" Ge- <|> match "GT" Gt- <|> match "IN" In'- <|> match "LE" Le- <|> match "LT" Lt- <|> match "NE" Ne- <|> match "NOT_CONTAINS" NotContains- <|> match "NOT_NULL" NotNull- <|> match "NULL" Null--instance ToText ComparisonOperator where- toText = \case- BeginsWith -> "BEGINS_WITH"- Between -> "BETWEEN"- Contains -> "CONTAINS"- Eq -> "EQ"- Ge -> "GE"- Gt -> "GT"- In' -> "IN"- Le -> "LE"- Lt -> "LT"- Ne -> "NE"- NotContains -> "NOT_CONTAINS"- NotNull -> "NOT_NULL"- Null -> "NULL"--instance ToByteString ComparisonOperator-instance ToHeader ComparisonOperator-instance ToQuery ComparisonOperator--instance FromJSON ComparisonOperator where- parseJSON = parseJSONText "ComparisonOperator"--instance ToJSON ComparisonOperator where- toJSON = toJSONText--data ReturnValue- = RVAllNew -- ^ ALL_NEW- | RVAllOld -- ^ ALL_OLD- | RVNone -- ^ NONE- | RVUpdatedNew -- ^ UPDATED_NEW- | RVUpdatedOld -- ^ UPDATED_OLD- deriving (Eq, Ord, Show, Generic, Enum)--instance Hashable ReturnValue--instance FromText ReturnValue where- parser = match "ALL_NEW" RVAllNew- <|> match "ALL_OLD" RVAllOld- <|> match "NONE" RVNone- <|> match "UPDATED_NEW" RVUpdatedNew- <|> match "UPDATED_OLD" RVUpdatedOld--instance ToText ReturnValue where- toText = \case- RVAllNew -> "ALL_NEW"- RVAllOld -> "ALL_OLD"- RVNone -> "NONE"- RVUpdatedNew -> "UPDATED_NEW"- RVUpdatedOld -> "UPDATED_OLD"--instance ToByteString ReturnValue-instance ToHeader ReturnValue-instance ToQuery ReturnValue--instance FromJSON ReturnValue where- parseJSON = parseJSONText "ReturnValue"--instance ToJSON ReturnValue where- toJSON = toJSONText--data LocalSecondaryIndex = LocalSecondaryIndex- { _lsiIndexName :: Text- , _lsiKeySchema :: List1 "KeySchema" KeySchemaElement- , _lsiProjection :: Projection- } deriving (Eq, Show)---- | 'LocalSecondaryIndex' constructor.------ The fields accessible through corresponding lenses are:------ * 'lsiIndexName' @::@ 'Text'------ * 'lsiKeySchema' @::@ 'NonEmpty' 'KeySchemaElement'------ * 'lsiProjection' @::@ 'Projection'----localSecondaryIndex :: Text -- ^ 'lsiIndexName'- -> NonEmpty KeySchemaElement -- ^ 'lsiKeySchema'- -> Projection -- ^ 'lsiProjection'- -> LocalSecondaryIndex-localSecondaryIndex p1 p2 p3 = LocalSecondaryIndex- { _lsiIndexName = p1- , _lsiKeySchema = withIso _List1 (const id) p2- , _lsiProjection = p3- }---- | The name of the local secondary index. The name must be unique among all--- other indexes on this table.-lsiIndexName :: Lens' LocalSecondaryIndex Text-lsiIndexName = lens _lsiIndexName (\s a -> s { _lsiIndexName = a })---- | The complete key schema for the local secondary index, consisting of one--- or more pairs of attribute names and key types (HASH or RANGE).-lsiKeySchema :: Lens' LocalSecondaryIndex (NonEmpty KeySchemaElement)-lsiKeySchema = lens _lsiKeySchema (\s a -> s { _lsiKeySchema = a }) . _List1--lsiProjection :: Lens' LocalSecondaryIndex Projection-lsiProjection = lens _lsiProjection (\s a -> s { _lsiProjection = a })--instance FromJSON LocalSecondaryIndex where- parseJSON = withObject "LocalSecondaryIndex" $ \o -> LocalSecondaryIndex- <$> o .: "IndexName"- <*> o .: "KeySchema"- <*> o .: "Projection"--instance ToJSON LocalSecondaryIndex where- toJSON LocalSecondaryIndex{..} = object- [ "IndexName" .= _lsiIndexName- , "KeySchema" .= _lsiKeySchema- , "Projection" .= _lsiProjection- ]--data GlobalSecondaryIndexDescription = GlobalSecondaryIndexDescription- { _gsidIndexName :: Maybe Text- , _gsidIndexSizeBytes :: Maybe Integer- , _gsidIndexStatus :: Maybe IndexStatus- , _gsidItemCount :: Maybe Integer- , _gsidKeySchema :: List1 "KeySchema" KeySchemaElement- , _gsidProjection :: Maybe Projection- , _gsidProvisionedThroughput :: Maybe ProvisionedThroughputDescription- } deriving (Eq, Show)---- | 'GlobalSecondaryIndexDescription' constructor.------ The fields accessible through corresponding lenses are:------ * 'gsidIndexName' @::@ 'Maybe' 'Text'------ * 'gsidIndexSizeBytes' @::@ 'Maybe' 'Integer'------ * 'gsidIndexStatus' @::@ 'Maybe' 'IndexStatus'------ * 'gsidItemCount' @::@ 'Maybe' 'Integer'------ * 'gsidKeySchema' @::@ 'NonEmpty' 'KeySchemaElement'------ * 'gsidProjection' @::@ 'Maybe' 'Projection'------ * 'gsidProvisionedThroughput' @::@ 'Maybe' 'ProvisionedThroughputDescription'----globalSecondaryIndexDescription :: NonEmpty KeySchemaElement -- ^ 'gsidKeySchema'- -> GlobalSecondaryIndexDescription-globalSecondaryIndexDescription p1 = GlobalSecondaryIndexDescription- { _gsidKeySchema = withIso _List1 (const id) p1- , _gsidIndexName = Nothing- , _gsidProjection = Nothing- , _gsidIndexStatus = Nothing- , _gsidProvisionedThroughput = Nothing- , _gsidIndexSizeBytes = Nothing- , _gsidItemCount = Nothing- }---- | The name of the global secondary index.-gsidIndexName :: Lens' GlobalSecondaryIndexDescription (Maybe Text)-gsidIndexName = lens _gsidIndexName (\s a -> s { _gsidIndexName = a })---- | The total size of the specified index, in bytes. DynamoDB updates this--- value approximately every six hours. Recent changes might not be--- reflected in this value.-gsidIndexSizeBytes :: Lens' GlobalSecondaryIndexDescription (Maybe Integer)-gsidIndexSizeBytes =- lens _gsidIndexSizeBytes (\s a -> s { _gsidIndexSizeBytes = a })---- | The current state of the global secondary index: CREATING - The index is--- being created, as the result of a CreateTable or UpdateTable operation.--- 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. ACTIVE - The index is ready for use.-gsidIndexStatus :: Lens' GlobalSecondaryIndexDescription (Maybe IndexStatus)-gsidIndexStatus = lens _gsidIndexStatus (\s a -> s { _gsidIndexStatus = a })---- | The number of items in the specified index. DynamoDB updates this value--- approximately every six hours. Recent changes might not be reflected in--- this value.-gsidItemCount :: Lens' GlobalSecondaryIndexDescription (Maybe Integer)-gsidItemCount = lens _gsidItemCount (\s a -> s { _gsidItemCount = a })---- | The complete key schema for the global secondary index, consisting of one--- or more pairs of attribute names and key types (HASH or RANGE).-gsidKeySchema :: Lens' GlobalSecondaryIndexDescription (NonEmpty KeySchemaElement)-gsidKeySchema = lens _gsidKeySchema (\s a -> s { _gsidKeySchema = a }) . _List1--gsidProjection :: Lens' GlobalSecondaryIndexDescription (Maybe Projection)-gsidProjection = lens _gsidProjection (\s a -> s { _gsidProjection = a })--gsidProvisionedThroughput :: Lens' GlobalSecondaryIndexDescription (Maybe ProvisionedThroughputDescription)-gsidProvisionedThroughput =- lens _gsidProvisionedThroughput- (\s a -> s { _gsidProvisionedThroughput = a })--instance FromJSON GlobalSecondaryIndexDescription where- parseJSON = withObject "GlobalSecondaryIndexDescription" $ \o -> GlobalSecondaryIndexDescription- <$> o .:? "IndexName"- <*> o .:? "IndexSizeBytes"- <*> o .:? "IndexStatus"- <*> o .:? "ItemCount"- <*> o .: "KeySchema"- <*> o .:? "Projection"- <*> o .:? "ProvisionedThroughput"--instance ToJSON GlobalSecondaryIndexDescription where- toJSON GlobalSecondaryIndexDescription{..} = object- [ "IndexName" .= _gsidIndexName- , "KeySchema" .= _gsidKeySchema- , "Projection" .= _gsidProjection- , "IndexStatus" .= _gsidIndexStatus- , "ProvisionedThroughput" .= _gsidProvisionedThroughput- , "IndexSizeBytes" .= _gsidIndexSizeBytes- , "ItemCount" .= _gsidItemCount- ]--data ItemCollectionMetrics = ItemCollectionMetrics- { _icmItemCollectionKey :: Map Text AttributeValue- , _icmSizeEstimateRangeGB :: List "SizeEstimateRangeGB" Double- } deriving (Eq, Show)---- | 'ItemCollectionMetrics' constructor.------ The fields accessible through corresponding lenses are:------ * 'icmItemCollectionKey' @::@ 'HashMap' 'Text' 'AttributeValue'------ * 'icmSizeEstimateRangeGB' @::@ ['Double']----itemCollectionMetrics :: ItemCollectionMetrics-itemCollectionMetrics = ItemCollectionMetrics- { _icmItemCollectionKey = mempty- , _icmSizeEstimateRangeGB = mempty- }---- | The hash key value of the item collection. This value is the same as the--- hash key of the item.-icmItemCollectionKey :: Lens' ItemCollectionMetrics (HashMap Text AttributeValue)-icmItemCollectionKey =- lens _icmItemCollectionKey (\s a -> s { _icmItemCollectionKey = a })- . _Map---- | An estimate of item collection size, in gigabytes. This value is a--- two-element array containing a lower bound and an upper bound for the--- estimate. The estimate includes the size of all the items in the table,--- plus the size of all attributes projected into all of the local secondary--- indexes on that table. Use this estimate to measure whether a local--- secondary index is approaching its size limit. The estimate is subject to--- change over time; therefore, do not rely on the precision or accuracy of--- the estimate.-icmSizeEstimateRangeGB :: Lens' ItemCollectionMetrics [Double]-icmSizeEstimateRangeGB =- lens _icmSizeEstimateRangeGB (\s a -> s { _icmSizeEstimateRangeGB = a })- . _List--instance FromJSON ItemCollectionMetrics where- parseJSON = withObject "ItemCollectionMetrics" $ \o -> ItemCollectionMetrics- <$> o .: "ItemCollectionKey"- <*> o .: "SizeEstimateRangeGB"--instance ToJSON ItemCollectionMetrics where- toJSON ItemCollectionMetrics{..} = object- [ "ItemCollectionKey" .= _icmItemCollectionKey- , "SizeEstimateRangeGB" .= _icmSizeEstimateRangeGB- ]--newtype Capacity = Capacity- { _cCapacityUnits :: Maybe Double- } deriving (Eq, Ord, Show)---- | 'Capacity' constructor.------ The fields accessible through corresponding lenses are:------ * 'cCapacityUnits' @::@ 'Maybe' 'Double'----capacity :: Capacity-capacity = Capacity- { _cCapacityUnits = Nothing- }---- | The total number of capacity units consumed on a table or an index.-cCapacityUnits :: Lens' Capacity (Maybe Double)-cCapacityUnits = lens _cCapacityUnits (\s a -> s { _cCapacityUnits = a })--instance FromJSON Capacity where- parseJSON = withObject "Capacity" $ \o -> Capacity- <$> o .:? "CapacityUnits"--instance ToJSON Capacity where- toJSON Capacity{..} = object- [ "CapacityUnits" .= _cCapacityUnits- ]--data ConsumedCapacity = ConsumedCapacity- { _ccCapacityUnits :: Maybe Double- , _ccGlobalSecondaryIndexes :: Map Text Capacity- , _ccLocalSecondaryIndexes :: Map Text Capacity- , _ccTable :: Maybe Capacity- , _ccTableName :: Maybe Text- } deriving (Eq, Show)---- | 'ConsumedCapacity' constructor.------ The fields accessible through corresponding lenses are:------ * 'ccCapacityUnits' @::@ 'Maybe' 'Double'------ * 'ccGlobalSecondaryIndexes' @::@ 'HashMap' 'Text' 'Capacity'------ * 'ccLocalSecondaryIndexes' @::@ 'HashMap' 'Text' 'Capacity'------ * 'ccTable' @::@ 'Maybe' 'Capacity'------ * 'ccTableName' @::@ 'Maybe' 'Text'----consumedCapacity :: ConsumedCapacity-consumedCapacity = ConsumedCapacity- { _ccTableName = Nothing- , _ccCapacityUnits = Nothing- , _ccTable = Nothing- , _ccLocalSecondaryIndexes = mempty- , _ccGlobalSecondaryIndexes = mempty- }---- | The total number of capacity units consumed by the operation.-ccCapacityUnits :: Lens' ConsumedCapacity (Maybe Double)-ccCapacityUnits = lens _ccCapacityUnits (\s a -> s { _ccCapacityUnits = a })---- | The amount of throughput consumed on each global index affected by the--- operation.-ccGlobalSecondaryIndexes :: Lens' ConsumedCapacity (HashMap Text Capacity)-ccGlobalSecondaryIndexes =- lens _ccGlobalSecondaryIndexes- (\s a -> s { _ccGlobalSecondaryIndexes = a })- . _Map---- | The amount of throughput consumed on each local index affected by the--- operation.-ccLocalSecondaryIndexes :: Lens' ConsumedCapacity (HashMap Text Capacity)-ccLocalSecondaryIndexes =- lens _ccLocalSecondaryIndexes (\s a -> s { _ccLocalSecondaryIndexes = a })- . _Map---- | The amount of throughput consumed on the table affected by the operation.-ccTable :: Lens' ConsumedCapacity (Maybe Capacity)-ccTable = lens _ccTable (\s a -> s { _ccTable = a })---- | The name of the table that was affected by the operation.-ccTableName :: Lens' ConsumedCapacity (Maybe Text)-ccTableName = lens _ccTableName (\s a -> s { _ccTableName = a })--instance FromJSON ConsumedCapacity where- parseJSON = withObject "ConsumedCapacity" $ \o -> ConsumedCapacity- <$> o .:? "CapacityUnits"- <*> o .: "GlobalSecondaryIndexes"- <*> o .: "LocalSecondaryIndexes"- <*> o .:? "Table"- <*> o .:? "TableName"--instance ToJSON ConsumedCapacity where- toJSON ConsumedCapacity{..} = object- [ "TableName" .= _ccTableName- , "CapacityUnits" .= _ccCapacityUnits- , "Table" .= _ccTable- , "LocalSecondaryIndexes" .= _ccLocalSecondaryIndexes- , "GlobalSecondaryIndexes" .= _ccGlobalSecondaryIndexes- ]--data GlobalSecondaryIndex = GlobalSecondaryIndex- { _gsiIndexName :: Text- , _gsiKeySchema :: List1 "KeySchema" KeySchemaElement- , _gsiProjection :: Projection- , _gsiProvisionedThroughput :: ProvisionedThroughput- } deriving (Eq, Show)---- | 'GlobalSecondaryIndex' constructor.------ The fields accessible through corresponding lenses are:------ * 'gsiIndexName' @::@ 'Text'------ * 'gsiKeySchema' @::@ 'NonEmpty' 'KeySchemaElement'------ * 'gsiProjection' @::@ 'Projection'------ * 'gsiProvisionedThroughput' @::@ 'ProvisionedThroughput'----globalSecondaryIndex :: Text -- ^ 'gsiIndexName'- -> NonEmpty KeySchemaElement -- ^ 'gsiKeySchema'- -> Projection -- ^ 'gsiProjection'- -> ProvisionedThroughput -- ^ 'gsiProvisionedThroughput'- -> GlobalSecondaryIndex-globalSecondaryIndex p1 p2 p3 p4 = GlobalSecondaryIndex- { _gsiIndexName = p1- , _gsiKeySchema = withIso _List1 (const id) p2- , _gsiProjection = p3- , _gsiProvisionedThroughput = p4- }---- | The name of the global secondary index. The name must be unique among all--- other indexes on this table.-gsiIndexName :: Lens' GlobalSecondaryIndex Text-gsiIndexName = lens _gsiIndexName (\s a -> s { _gsiIndexName = a })---- | The complete key schema for a global secondary index, which consists of--- one or more pairs of attribute names and key types (HASH or RANGE).-gsiKeySchema :: Lens' GlobalSecondaryIndex (NonEmpty KeySchemaElement)-gsiKeySchema = lens _gsiKeySchema (\s a -> s { _gsiKeySchema = a }) . _List1--gsiProjection :: Lens' GlobalSecondaryIndex Projection-gsiProjection = lens _gsiProjection (\s a -> s { _gsiProjection = a })--gsiProvisionedThroughput :: Lens' GlobalSecondaryIndex ProvisionedThroughput-gsiProvisionedThroughput =- lens _gsiProvisionedThroughput- (\s a -> s { _gsiProvisionedThroughput = a })--instance FromJSON GlobalSecondaryIndex where- parseJSON = withObject "GlobalSecondaryIndex" $ \o -> GlobalSecondaryIndex- <$> o .: "IndexName"- <*> o .: "KeySchema"- <*> o .: "Projection"- <*> o .: "ProvisionedThroughput"--instance ToJSON GlobalSecondaryIndex where- toJSON GlobalSecondaryIndex{..} = object- [ "IndexName" .= _gsiIndexName- , "KeySchema" .= _gsiKeySchema- , "Projection" .= _gsiProjection- , "ProvisionedThroughput" .= _gsiProvisionedThroughput- ]--data LocalSecondaryIndexDescription = LocalSecondaryIndexDescription- { _lsidIndexName :: Maybe Text- , _lsidIndexSizeBytes :: Maybe Integer- , _lsidItemCount :: Maybe Integer- , _lsidKeySchema :: List1 "KeySchema" KeySchemaElement- , _lsidProjection :: Maybe Projection- } deriving (Eq, Show)---- | 'LocalSecondaryIndexDescription' constructor.------ The fields accessible through corresponding lenses are:------ * 'lsidIndexName' @::@ 'Maybe' 'Text'------ * 'lsidIndexSizeBytes' @::@ 'Maybe' 'Integer'------ * 'lsidItemCount' @::@ 'Maybe' 'Integer'------ * 'lsidKeySchema' @::@ 'NonEmpty' 'KeySchemaElement'------ * 'lsidProjection' @::@ 'Maybe' 'Projection'----localSecondaryIndexDescription :: NonEmpty KeySchemaElement -- ^ 'lsidKeySchema'- -> LocalSecondaryIndexDescription-localSecondaryIndexDescription p1 = LocalSecondaryIndexDescription- { _lsidKeySchema = withIso _List1 (const id) p1- , _lsidIndexName = Nothing- , _lsidProjection = Nothing- , _lsidIndexSizeBytes = Nothing- , _lsidItemCount = Nothing- }---- | Represents the name of the local secondary index.-lsidIndexName :: Lens' LocalSecondaryIndexDescription (Maybe Text)-lsidIndexName = lens _lsidIndexName (\s a -> s { _lsidIndexName = a })---- | The total size of the specified index, in bytes. DynamoDB updates this--- value approximately every six hours. Recent changes might not be--- reflected in this value.-lsidIndexSizeBytes :: Lens' LocalSecondaryIndexDescription (Maybe Integer)-lsidIndexSizeBytes =- lens _lsidIndexSizeBytes (\s a -> s { _lsidIndexSizeBytes = a })---- | The number of items in the specified index. DynamoDB updates this value--- approximately every six hours. Recent changes might not be reflected in--- this value.-lsidItemCount :: Lens' LocalSecondaryIndexDescription (Maybe Integer)-lsidItemCount = lens _lsidItemCount (\s a -> s { _lsidItemCount = a })---- | The complete index key schema, which consists of one or more pairs of--- attribute names and key types (HASH or RANGE).-lsidKeySchema :: Lens' LocalSecondaryIndexDescription (NonEmpty KeySchemaElement)-lsidKeySchema = lens _lsidKeySchema (\s a -> s { _lsidKeySchema = a }) . _List1--lsidProjection :: Lens' LocalSecondaryIndexDescription (Maybe Projection)-lsidProjection = lens _lsidProjection (\s a -> s { _lsidProjection = a })--instance FromJSON LocalSecondaryIndexDescription where- parseJSON = withObject "LocalSecondaryIndexDescription" $ \o -> LocalSecondaryIndexDescription- <$> o .:? "IndexName"- <*> o .:? "IndexSizeBytes"- <*> o .:? "ItemCount"- <*> o .: "KeySchema"- <*> o .:? "Projection"--instance ToJSON LocalSecondaryIndexDescription where- toJSON LocalSecondaryIndexDescription{..} = object- [ "IndexName" .= _lsidIndexName- , "KeySchema" .= _lsidKeySchema- , "Projection" .= _lsidProjection- , "IndexSizeBytes" .= _lsidIndexSizeBytes- , "ItemCount" .= _lsidItemCount- ]--data AttributeAction- = Add -- ^ ADD- | Delete' -- ^ DELETE- | Put -- ^ PUT- deriving (Eq, Ord, Show, Generic, Enum)--instance Hashable AttributeAction--instance FromText AttributeAction where- parser = match "ADD" Add- <|> match "DELETE" Delete'- <|> match "PUT" Put--instance ToText AttributeAction where- toText = \case- Add -> "ADD"- Delete' -> "DELETE"- Put -> "PUT"--instance ToByteString AttributeAction-instance ToHeader AttributeAction-instance ToQuery AttributeAction--instance FromJSON AttributeAction where- parseJSON = parseJSONText "AttributeAction"--instance ToJSON AttributeAction where- toJSON = toJSONText--data ScalarAttributeType- = B -- ^ B- | N -- ^ N- | S -- ^ S- deriving (Eq, Ord, Show, Generic, Enum)--instance Hashable ScalarAttributeType--instance FromText ScalarAttributeType where- parser = match "B" B- <|> match "N" N- <|> match "S" S--instance ToText ScalarAttributeType where- toText = \case- B -> "B"- N -> "N"- S -> "S"--instance ToByteString ScalarAttributeType-instance ToHeader ScalarAttributeType-instance ToQuery ScalarAttributeType--instance FromJSON ScalarAttributeType where- parseJSON = parseJSONText "ScalarAttributeType"--instance ToJSON ScalarAttributeType where- toJSON = toJSONText--data Projection = Projection- { _pNonKeyAttributes :: List1 "NonKeyAttributes" Text- , _pProjectionType :: Maybe ProjectionType- } deriving (Eq, Show)---- | 'Projection' constructor.------ The fields accessible through corresponding lenses are:------ * 'pNonKeyAttributes' @::@ 'NonEmpty' 'Text'------ * 'pProjectionType' @::@ 'Maybe' 'ProjectionType'----projection :: NonEmpty Text -- ^ 'pNonKeyAttributes'- -> Projection-projection p1 = Projection- { _pNonKeyAttributes = withIso _List1 (const id) p1- , _pProjectionType = Nothing- }---- | Represents the non-key attribute names which will be projected into the--- index. For local secondary indexes, the total count of NonKeyAttributes--- summed across all of the local secondary indexes, must not exceed 20. If--- you project the same attribute into two different indexes, this counts as--- two distinct attributes when determining the total.-pNonKeyAttributes :: Lens' Projection (NonEmpty Text)-pNonKeyAttributes =- lens _pNonKeyAttributes (\s a -> s { _pNonKeyAttributes = a })- . _List1---- | The set of attributes that are projected into the index: KEYS_ONLY - Only--- the index and primary keys are projected into the index. INCLUDE - Only--- the specified table attributes are projected into the index. The list of--- projected attributes are in NonKeyAttributes. ALL - All of the table--- attributes are projected into the index.-pProjectionType :: Lens' Projection (Maybe ProjectionType)-pProjectionType = lens _pProjectionType (\s a -> s { _pProjectionType = a })--instance FromJSON Projection where- parseJSON = withObject "Projection" $ \o -> Projection- <$> o .: "NonKeyAttributes"- <*> o .:? "ProjectionType"--instance ToJSON Projection where- toJSON Projection{..} = object- [ "ProjectionType" .= _pProjectionType- , "NonKeyAttributes" .= _pNonKeyAttributes- ]--data Select- = AllAttributes -- ^ ALL_ATTRIBUTES- | AllProjectedAttributes -- ^ ALL_PROJECTED_ATTRIBUTES- | Count -- ^ COUNT- | SpecificAttributes -- ^ SPECIFIC_ATTRIBUTES- deriving (Eq, Ord, Show, Generic, Enum)--instance Hashable Select--instance FromText Select where- parser = match "ALL_ATTRIBUTES" AllAttributes- <|> match "ALL_PROJECTED_ATTRIBUTES" AllProjectedAttributes- <|> match "COUNT" Count- <|> match "SPECIFIC_ATTRIBUTES" SpecificAttributes--instance ToText Select where- toText = \case- AllAttributes -> "ALL_ATTRIBUTES"- AllProjectedAttributes -> "ALL_PROJECTED_ATTRIBUTES"- Count -> "COUNT"- SpecificAttributes -> "SPECIFIC_ATTRIBUTES"--instance ToByteString Select-instance ToHeader Select-instance ToQuery Select--instance FromJSON Select where- parseJSON = parseJSONText "Select"--instance ToJSON Select where- toJSON = toJSONText--data KeySchemaElement = KeySchemaElement- { _kseAttributeName :: Text- , _kseKeyType :: KeyType- } deriving (Eq, Show)---- | 'KeySchemaElement' constructor.------ The fields accessible through corresponding lenses are:------ * 'kseAttributeName' @::@ 'Text'------ * 'kseKeyType' @::@ 'KeyType'----keySchemaElement :: Text -- ^ 'kseAttributeName'- -> KeyType -- ^ 'kseKeyType'- -> KeySchemaElement-keySchemaElement p1 p2 = KeySchemaElement- { _kseAttributeName = p1- , _kseKeyType = p2- }---- | The name of a key attribute.-kseAttributeName :: Lens' KeySchemaElement Text-kseAttributeName = lens _kseAttributeName (\s a -> s { _kseAttributeName = a })---- | The attribute data, consisting of the data type and the attribute value--- itself.-kseKeyType :: Lens' KeySchemaElement KeyType-kseKeyType = lens _kseKeyType (\s a -> s { _kseKeyType = a })--instance FromJSON KeySchemaElement where- parseJSON = withObject "KeySchemaElement" $ \o -> KeySchemaElement- <$> o .: "AttributeName"- <*> o .: "KeyType"--instance ToJSON KeySchemaElement where- toJSON KeySchemaElement{..} = object- [ "AttributeName" .= _kseAttributeName- , "KeyType" .= _kseKeyType- ]--newtype DeleteRequest = DeleteRequest- { _dKey :: Map Text AttributeValue- } deriving (Eq, Show, Monoid, Semigroup)---- | 'DeleteRequest' constructor.------ The fields accessible through corresponding lenses are:------ * 'dKey' @::@ 'HashMap' 'Text' 'AttributeValue'----deleteRequest :: DeleteRequest-deleteRequest = DeleteRequest- { _dKey = mempty- }---- | A map of attribute name to attribute values, representing the primary key--- of the item to delete. All of the table's primary key attributes must be--- specified, and their data types must match those of the table's key--- schema.-dKey :: Lens' DeleteRequest (HashMap Text AttributeValue)-dKey = lens _dKey (\s a -> s { _dKey = a }) . _Map--instance FromJSON DeleteRequest where- parseJSON = withObject "DeleteRequest" $ \o -> DeleteRequest- <$> o .: "Key"--instance ToJSON DeleteRequest where- toJSON DeleteRequest{..} = object- [ "Key" .= _dKey- ]--data UpdateGlobalSecondaryIndexAction = UpdateGlobalSecondaryIndexAction- { _ugsiaIndexName :: Text- , _ugsiaProvisionedThroughput :: ProvisionedThroughput- } deriving (Eq, Show)---- | 'UpdateGlobalSecondaryIndexAction' constructor.------ The fields accessible through corresponding lenses are:------ * 'ugsiaIndexName' @::@ 'Text'------ * 'ugsiaProvisionedThroughput' @::@ 'ProvisionedThroughput'----updateGlobalSecondaryIndexAction :: Text -- ^ 'ugsiaIndexName'- -> ProvisionedThroughput -- ^ 'ugsiaProvisionedThroughput'- -> UpdateGlobalSecondaryIndexAction-updateGlobalSecondaryIndexAction p1 p2 = UpdateGlobalSecondaryIndexAction- { _ugsiaIndexName = p1- , _ugsiaProvisionedThroughput = p2- }---- | The name of the global secondary index to be updated.-ugsiaIndexName :: Lens' UpdateGlobalSecondaryIndexAction Text-ugsiaIndexName = lens _ugsiaIndexName (\s a -> s { _ugsiaIndexName = a })--ugsiaProvisionedThroughput :: Lens' UpdateGlobalSecondaryIndexAction ProvisionedThroughput-ugsiaProvisionedThroughput =- lens _ugsiaProvisionedThroughput- (\s a -> s { _ugsiaProvisionedThroughput = a })--instance FromJSON UpdateGlobalSecondaryIndexAction where- parseJSON = withObject "UpdateGlobalSecondaryIndexAction" $ \o -> UpdateGlobalSecondaryIndexAction- <$> o .: "IndexName"- <*> o .: "ProvisionedThroughput"--instance ToJSON UpdateGlobalSecondaryIndexAction where- toJSON UpdateGlobalSecondaryIndexAction{..} = object- [ "IndexName" .= _ugsiaIndexName- , "ProvisionedThroughput" .= _ugsiaProvisionedThroughput- ]--newtype PutRequest = PutRequest- { _pItem :: Map Text AttributeValue- } deriving (Eq, Show, Monoid, Semigroup)---- | 'PutRequest' constructor.------ The fields accessible through corresponding lenses are:------ * 'pItem' @::@ 'HashMap' 'Text' 'AttributeValue'----putRequest :: PutRequest-putRequest = PutRequest- { _pItem = mempty- }---- | A map of attribute name to attribute values, representing the primary key--- of an item to be processed by PutItem. All of the table's primary key--- attributes must be specified, and their data types must match those of--- the table's key schema. If any attributes are present in the item which--- are part of an index key schema for the table, their types must match the--- index key schema.-pItem :: Lens' PutRequest (HashMap Text AttributeValue)-pItem = lens _pItem (\s a -> s { _pItem = a }) . _Map--instance FromJSON PutRequest where- parseJSON = withObject "PutRequest" $ \o -> PutRequest- <$> o .: "Item"--instance ToJSON PutRequest where- toJSON PutRequest{..} = object- [ "Item" .= _pItem- ]--data Condition = Condition- { _cAttributeValueList :: List "AttributeValueList" AttributeValue- , _cComparisonOperator :: ComparisonOperator- } deriving (Eq, Show)---- | 'Condition' constructor.------ The fields accessible through corresponding lenses are:------ * 'cAttributeValueList' @::@ ['AttributeValue']------ * 'cComparisonOperator' @::@ 'ComparisonOperator'----condition :: ComparisonOperator -- ^ 'cComparisonOperator'- -> Condition-condition p1 = Condition- { _cComparisonOperator = p1- , _cAttributeValueList = mempty- }---- | One or more values to evaluate against the supplied attribute. The number--- of values in the list depends on the ComparisonOperator being used. 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 greater than B. For a--- list of code values, see--- http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters. For--- Binary, DynamoDB treats each byte of the binary data as unsigned when it--- compares binary values, for example when evaluating query expressions.-cAttributeValueList :: Lens' Condition [AttributeValue]-cAttributeValueList =- lens _cAttributeValueList (\s a -> s { _cAttributeValueList = a })- . _List---- | A comparator for evaluating attributes. For example, equals, greater--- than, less than, etc. The following comparison operators are available:--- EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS |--- BEGINS_WITH | IN | BETWEEN The following are descriptions of each--- comparison operator. EQ : Equal. EQ is supported for all datatypes,--- including lists and maps. AttributeValueList can contain only one--- AttributeValue element of type String, Number, Binary, String Set, Number--- Set, or Binary Set. If an item contains an AttributeValue element of a--- different type than the one specified in the request, the value does not--- match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}--- does not equal {"NS":["6", "2", "1"]}. NE : Not equal. NE is supported--- for all datatypes, including lists and maps. AttributeValueList can--- contain only one AttributeValue of type String, Number, Binary, String--- Set, Number Set, or Binary Set. If an item contains an AttributeValue of--- a different type than the one specified in the request, the value does--- not match. For example, {"S":"6"} does not equal {"N":"6"}. Also,--- {"N":"6"} does not equal {"NS":["6", "2", "1"]}. LE : Less than or equal.--- AttributeValueList can contain only one AttributeValue element of type--- String, Number, or Binary (not a set type). If an item contains an--- AttributeValue element of a different type than the one specified in the--- request, the value does not match. For example, {"S":"6"} does not equal--- {"N":"6"}. Also, {"N":"6"} does not compare to {"NS":["6", "2", "1"]}. LT--- : Less than. AttributeValueList can contain only one AttributeValue of--- type String, Number, or Binary (not a set type). If an item contains an--- AttributeValue element of a different type than the one specified in the--- request, the value does not match. For example, {"S":"6"} does not equal--- {"N":"6"}. Also, {"N":"6"} does not compare to {"NS":["6", "2", "1"]}. GE--- : Greater than or equal. AttributeValueList can contain only one--- AttributeValue element of type String, Number, or Binary (not a set--- type). If an item contains an AttributeValue element of a different type--- than the one specified in the request, the value does not match. For--- example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not--- compare to {"NS":["6", "2", "1"]}. GT : Greater than. AttributeValueList--- can contain only one AttributeValue element of type String, Number, or--- Binary (not a set type). If an item contains an AttributeValue element of--- a different type than the one specified in the request, the value does--- not match. For example, {"S":"6"} does not equal {"N":"6"}. Also,--- {"N":"6"} does not compare to {"NS":["6", "2", "1"]}. NOT_NULL : The--- attribute exists. NOT_NULL is supported for all datatypes, including--- lists and maps. NULL : The attribute does not exist. NULL is supported--- for all datatypes, including lists and maps. CONTAINS : Checks for a--- subsequence, or value in a set. AttributeValueList can contain only one--- AttributeValue element of type String, Number, or Binary (not a set--- type). If the target attribute of the comparison is of type String, then--- the operator checks for a substring match. If the target attribute of the--- comparison is of type Binary, then the operator looks for a subsequence--- of the target that matches the input. If the target attribute of the--- comparison is a set ("SS", "NS", or "BS"), then the operator evaluates to--- true if it finds an exact match with any member of the set. CONTAINS is--- supported for lists: When evaluating "a CONTAINS b", "a" can be a list;--- however, "b" cannot be a set, a map, or a list. NOT_CONTAINS : Checks for--- absence of a subsequence, or absence of a value in a set.--- AttributeValueList can contain only one AttributeValue element of type--- String, Number, or Binary (not a set type). If the target attribute of--- the comparison is a String, then the operator checks for the absence of a--- substring match. If the target attribute of the comparison is Binary,--- then the operator checks for the absence of a subsequence of the target--- that matches the input. If the target attribute of the comparison is a--- set ("SS", "NS", or "BS"), then the operator evaluates to true if it does--- not find an exact match with any member of the set. NOT_CONTAINS is--- supported for lists: When evaluating "a NOT CONTAINS b", "a" can be a--- list; however, "b" cannot be a set, a map, or a list. BEGINS_WITH :--- Checks for a prefix. AttributeValueList can contain only one--- AttributeValue of type String or Binary (not a Number or a set type). The--- target attribute of the comparison must be of type String or Binary (not--- a Number or a set type). IN : Checks for matching elements within two--- sets. AttributeValueList can contain one or more AttributeValue elements--- of type String, Number, or Binary (not a set type). These attributes are--- compared against an existing set type attribute of an item. If any--- elements of the input set are present in the item attribute, the--- expression evaluates to true. BETWEEN : Greater than or equal to the--- first value, and less than or equal to the second value.--- AttributeValueList must contain two AttributeValue elements of the same--- type, either String, Number, or Binary (not a set type). A target--- attribute matches if the target value is greater than, or equal to, the--- first element and less than, or equal to, the second element. If an item--- contains an AttributeValue element of a different type than the one--- specified in the request, the value does not match. For example,--- {"S":"6"} does not compare to {"N":"6"}. Also, {"N":"6"} does not compare--- to {"NS":["6", "2", "1"]} For usage examples of AttributeValueList and--- ComparisonOperator, see Legacy Conditional Parameters in the Amazon--- DynamoDB Developer Guide.-cComparisonOperator :: Lens' Condition ComparisonOperator-cComparisonOperator =- lens _cComparisonOperator (\s a -> s { _cComparisonOperator = a })--instance FromJSON Condition where- parseJSON = withObject "Condition" $ \o -> Condition- <$> o .: "AttributeValueList"- <*> o .: "ComparisonOperator"--instance ToJSON Condition where- toJSON Condition{..} = object- [ "AttributeValueList" .= _cAttributeValueList- , "ComparisonOperator" .= _cComparisonOperator- ]--data ConditionalOperator- = And -- ^ AND- | Or -- ^ OR- deriving (Eq, Ord, Show, Generic, Enum)--instance Hashable ConditionalOperator--instance FromText ConditionalOperator where- parser = match "AND" And- <|> match "OR" Or+-- | A request to perform a /DeleteItem/ operation.+wDeleteRequest :: Lens' WriteRequest (Maybe DeleteRequest)+wDeleteRequest = lens _wDeleteRequest (\s a -> s { _wDeleteRequest = a })++-- | A request to perform a /PutItem/ operation.+wPutRequest :: Lens' WriteRequest (Maybe PutRequest)+wPutRequest = lens _wPutRequest (\s a -> s { _wPutRequest = a })++instance FromJSON WriteRequest where+ parseJSON = withObject "WriteRequest" $ \o -> WriteRequest+ <$> o .:? "DeleteRequest"+ <*> o .:? "PutRequest"++instance ToJSON WriteRequest where+ toJSON WriteRequest{..} = object+ [ "PutRequest" .= _wPutRequest+ , "DeleteRequest" .= _wDeleteRequest+ ]++data ProvisionedThroughputDescription = ProvisionedThroughputDescription+ { _ptdLastDecreaseDateTime :: Maybe ISO8601+ , _ptdLastIncreaseDateTime :: Maybe ISO8601+ , _ptdNumberOfDecreasesToday :: Maybe Nat+ , _ptdReadCapacityUnits :: Maybe Nat+ , _ptdWriteCapacityUnits :: Maybe Nat+ } deriving (Eq, Ord, Show)++-- | 'ProvisionedThroughputDescription' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'ptdLastDecreaseDateTime' @::@ 'Maybe' 'UTCTime'+--+-- * 'ptdLastIncreaseDateTime' @::@ 'Maybe' 'UTCTime'+--+-- * 'ptdNumberOfDecreasesToday' @::@ 'Maybe' 'Natural'+--+-- * 'ptdReadCapacityUnits' @::@ 'Maybe' 'Natural'+--+-- * 'ptdWriteCapacityUnits' @::@ 'Maybe' 'Natural'+--+provisionedThroughputDescription :: ProvisionedThroughputDescription+provisionedThroughputDescription = ProvisionedThroughputDescription+ { _ptdLastIncreaseDateTime = Nothing+ , _ptdLastDecreaseDateTime = Nothing+ , _ptdNumberOfDecreasesToday = Nothing+ , _ptdReadCapacityUnits = Nothing+ , _ptdWriteCapacityUnits = Nothing+ }++-- | The date and time of the last provisioned throughput decrease for this table.+ptdLastDecreaseDateTime :: Lens' ProvisionedThroughputDescription (Maybe UTCTime)+ptdLastDecreaseDateTime =+ lens _ptdLastDecreaseDateTime (\s a -> s { _ptdLastDecreaseDateTime = a })+ . mapping _Time++-- | The date and time of the last provisioned throughput increase for this table.+ptdLastIncreaseDateTime :: Lens' ProvisionedThroughputDescription (Maybe UTCTime)+ptdLastIncreaseDateTime =+ lens _ptdLastIncreaseDateTime (\s a -> s { _ptdLastIncreaseDateTime = a })+ . mapping _Time++-- | The number of provisioned throughput decreases for this table during this UTC+-- calendar day. For current maximums on provisioned throughput decreases, see <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html Limits> in the /Amazon DynamoDB Developer Guide/.+ptdNumberOfDecreasesToday :: Lens' ProvisionedThroughputDescription (Maybe Natural)+ptdNumberOfDecreasesToday =+ lens _ptdNumberOfDecreasesToday+ (\s a -> s { _ptdNumberOfDecreasesToday = a })+ . mapping _Nat++-- | The maximum number of strongly consistent reads consumed per second before+-- DynamoDB returns a /ThrottlingException/. Eventually consistent reads require+-- less effort than strongly consistent reads, so a setting of 50 /ReadCapacityUnits/ per second provides 100 eventually consistent /ReadCapacityUnits/ per second.+ptdReadCapacityUnits :: Lens' ProvisionedThroughputDescription (Maybe Natural)+ptdReadCapacityUnits =+ lens _ptdReadCapacityUnits (\s a -> s { _ptdReadCapacityUnits = a })+ . mapping _Nat++-- | The maximum number of writes consumed per second before DynamoDB returns a /ThrottlingException/.+ptdWriteCapacityUnits :: Lens' ProvisionedThroughputDescription (Maybe Natural)+ptdWriteCapacityUnits =+ lens _ptdWriteCapacityUnits (\s a -> s { _ptdWriteCapacityUnits = a })+ . mapping _Nat++instance FromJSON ProvisionedThroughputDescription where+ parseJSON = withObject "ProvisionedThroughputDescription" $ \o -> ProvisionedThroughputDescription+ <$> o .:? "LastDecreaseDateTime"+ <*> o .:? "LastIncreaseDateTime"+ <*> o .:? "NumberOfDecreasesToday"+ <*> o .:? "ReadCapacityUnits"+ <*> o .:? "WriteCapacityUnits"++instance ToJSON ProvisionedThroughputDescription where+ toJSON ProvisionedThroughputDescription{..} = object+ [ "LastIncreaseDateTime" .= _ptdLastIncreaseDateTime+ , "LastDecreaseDateTime" .= _ptdLastDecreaseDateTime+ , "NumberOfDecreasesToday" .= _ptdNumberOfDecreasesToday+ , "ReadCapacityUnits" .= _ptdReadCapacityUnits+ , "WriteCapacityUnits" .= _ptdWriteCapacityUnits+ ]++data KeyType+ = Hash -- ^ HASH+ | Range -- ^ RANGE+ deriving (Eq, Ord, Show, Generic, Enum)++instance Hashable KeyType++instance FromText KeyType where+ parser = takeText >>= \case+ "HASH" -> pure Hash+ "RANGE" -> pure Range+ e -> fail $+ "Failure parsing KeyType from " ++ show e++instance ToText KeyType where+ toText = \case+ Hash -> "HASH"+ Range -> "RANGE"++instance ToByteString KeyType+instance ToHeader KeyType+instance ToQuery KeyType++instance FromJSON KeyType where+ parseJSON = parseJSONText "KeyType"++instance ToJSON KeyType where+ toJSON = toJSONText++data AttributeValue = AttributeValue+ { _avB :: Maybe Base64+ , _avBOOL :: Maybe Bool+ , _avBS :: List "BS" Base64+ , _avL :: List "L" AttributeValue+ , _avM :: Map Text AttributeValue+ , _avN :: Maybe Text+ , _avNS :: List "NS" Text+ , _avNULL :: Maybe Bool+ , _avS :: Maybe Text+ , _avSS :: List "SS" Text+ } deriving (Eq, Show)++-- | 'AttributeValue' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'avB' @::@ 'Maybe' 'Base64'+--+-- * 'avBOOL' @::@ 'Maybe' 'Bool'+--+-- * 'avBS' @::@ ['Base64']+--+-- * 'avL' @::@ ['AttributeValue']+--+-- * 'avM' @::@ 'HashMap' 'Text' 'AttributeValue'+--+-- * 'avN' @::@ 'Maybe' 'Text'+--+-- * 'avNS' @::@ ['Text']+--+-- * 'avNULL' @::@ 'Maybe' 'Bool'+--+-- * 'avS' @::@ 'Maybe' 'Text'+--+-- * 'avSS' @::@ ['Text']+--+attributeValue :: AttributeValue+attributeValue = AttributeValue+ { _avS = Nothing+ , _avN = Nothing+ , _avB = Nothing+ , _avSS = mempty+ , _avNS = mempty+ , _avBS = mempty+ , _avM = mempty+ , _avL = mempty+ , _avNULL = Nothing+ , _avBOOL = Nothing+ }++-- | A Binary data type.+avB :: Lens' AttributeValue (Maybe Base64)+avB = lens _avB (\s a -> s { _avB = a })++-- | A Boolean data type.+avBOOL :: Lens' AttributeValue (Maybe Bool)+avBOOL = lens _avBOOL (\s a -> s { _avBOOL = a })++-- | A Binary Set data type.+avBS :: Lens' AttributeValue [Base64]+avBS = lens _avBS (\s a -> s { _avBS = a }) . _List++-- | A List of attribute values.+avL :: Lens' AttributeValue [AttributeValue]+avL = lens _avL (\s a -> s { _avL = a }) . _List++-- | A Map of attribute values.+avM :: Lens' AttributeValue (HashMap Text AttributeValue)+avM = lens _avM (\s a -> s { _avM = a }) . _Map++-- | A Number data type.+avN :: Lens' AttributeValue (Maybe Text)+avN = lens _avN (\s a -> s { _avN = a })++-- | A Number Set data type.+avNS :: Lens' AttributeValue [Text]+avNS = lens _avNS (\s a -> s { _avNS = a }) . _List++-- | A Null data type.+avNULL :: Lens' AttributeValue (Maybe Bool)+avNULL = lens _avNULL (\s a -> s { _avNULL = a })++-- | A String data type.+avS :: Lens' AttributeValue (Maybe Text)+avS = lens _avS (\s a -> s { _avS = a })++-- | A String Set data type.+avSS :: Lens' AttributeValue [Text]+avSS = lens _avSS (\s a -> s { _avSS = a }) . _List++instance FromJSON AttributeValue where+ parseJSON = withObject "AttributeValue" $ \o -> AttributeValue+ <$> o .:? "B"+ <*> o .:? "BOOL"+ <*> o .: "BS"+ <*> o .: "L"+ <*> o .: "M"+ <*> o .:? "N"+ <*> o .: "NS"+ <*> o .:? "NULL"+ <*> o .:? "S"+ <*> o .: "SS"++instance ToJSON AttributeValue where+ toJSON AttributeValue{..} = object+ [ "S" .= _avS+ , "N" .= _avN+ , "B" .= _avB+ , "SS" .= _avSS+ , "NS" .= _avNS+ , "BS" .= _avBS+ , "M" .= _avM+ , "L" .= _avL+ , "NULL" .= _avNULL+ , "BOOL" .= _avBOOL+ ]++data IndexStatus+ = Active -- ^ ACTIVE+ | Creating -- ^ CREATING+ | Deleting -- ^ DELETING+ | Updating -- ^ UPDATING+ deriving (Eq, Ord, Show, Generic, Enum)++instance Hashable IndexStatus++instance FromText IndexStatus where+ parser = takeText >>= \case+ "ACTIVE" -> pure Active+ "CREATING" -> pure Creating+ "DELETING" -> pure Deleting+ "UPDATING" -> pure Updating+ e -> fail $+ "Failure parsing IndexStatus from " ++ show e++instance ToText IndexStatus where+ toText = \case+ Active -> "ACTIVE"+ Creating -> "CREATING"+ Deleting -> "DELETING"+ Updating -> "UPDATING"++instance ToByteString IndexStatus+instance ToHeader IndexStatus+instance ToQuery IndexStatus++instance FromJSON IndexStatus where+ parseJSON = parseJSONText "IndexStatus"++instance ToJSON IndexStatus where+ toJSON = toJSONText++data ProvisionedThroughput = ProvisionedThroughput+ { _ptReadCapacityUnits :: Nat+ , _ptWriteCapacityUnits :: Nat+ } deriving (Eq, Ord, Show)++-- | 'ProvisionedThroughput' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'ptReadCapacityUnits' @::@ 'Natural'+--+-- * 'ptWriteCapacityUnits' @::@ 'Natural'+--+provisionedThroughput :: Natural -- ^ 'ptReadCapacityUnits'+ -> Natural -- ^ 'ptWriteCapacityUnits'+ -> ProvisionedThroughput+provisionedThroughput p1 p2 = ProvisionedThroughput+ { _ptReadCapacityUnits = withIso _Nat (const id) p1+ , _ptWriteCapacityUnits = withIso _Nat (const id) p2+ }++-- | The maximum number of strongly consistent reads consumed per second before+-- DynamoDB returns a /ThrottlingException/. For more information, see <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput SpecifyingRead and Write Requirements> in the /Amazon DynamoDB Developer Guide/.+ptReadCapacityUnits :: Lens' ProvisionedThroughput Natural+ptReadCapacityUnits =+ lens _ptReadCapacityUnits (\s a -> s { _ptReadCapacityUnits = a })+ . _Nat++-- | The maximum number of writes consumed per second before DynamoDB returns a /ThrottlingException/. For more information, see <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput Specifying Read and Write Requirements> in the /Amazon DynamoDB Developer Guide/.+ptWriteCapacityUnits :: Lens' ProvisionedThroughput Natural+ptWriteCapacityUnits =+ lens _ptWriteCapacityUnits (\s a -> s { _ptWriteCapacityUnits = a })+ . _Nat++instance FromJSON ProvisionedThroughput where+ parseJSON = withObject "ProvisionedThroughput" $ \o -> ProvisionedThroughput+ <$> o .: "ReadCapacityUnits"+ <*> o .: "WriteCapacityUnits"++instance ToJSON ProvisionedThroughput where+ toJSON ProvisionedThroughput{..} = object+ [ "ReadCapacityUnits" .= _ptReadCapacityUnits+ , "WriteCapacityUnits" .= _ptWriteCapacityUnits+ ]++data TableStatus+ = TSActive -- ^ ACTIVE+ | TSCreating -- ^ CREATING+ | TSDeleting -- ^ DELETING+ | TSUpdating -- ^ UPDATING+ deriving (Eq, Ord, Show, Generic, Enum)++instance Hashable TableStatus++instance FromText TableStatus where+ parser = takeText >>= \case+ "ACTIVE" -> pure TSActive+ "CREATING" -> pure TSCreating+ "DELETING" -> pure TSDeleting+ "UPDATING" -> pure TSUpdating+ e -> fail $+ "Failure parsing TableStatus from " ++ show e++instance ToText TableStatus where+ toText = \case+ TSActive -> "ACTIVE"+ TSCreating -> "CREATING"+ TSDeleting -> "DELETING"+ TSUpdating -> "UPDATING"++instance ToByteString TableStatus+instance ToHeader TableStatus+instance ToQuery TableStatus++instance FromJSON TableStatus where+ parseJSON = parseJSONText "TableStatus"++instance ToJSON TableStatus where+ toJSON = toJSONText++data ProjectionType+ = All -- ^ ALL+ | Include -- ^ INCLUDE+ | KeysOnly -- ^ KEYS_ONLY+ deriving (Eq, Ord, Show, Generic, Enum)++instance Hashable ProjectionType++instance FromText ProjectionType where+ parser = takeText >>= \case+ "ALL" -> pure All+ "INCLUDE" -> pure Include+ "KEYS_ONLY" -> pure KeysOnly+ e -> fail $+ "Failure parsing ProjectionType from " ++ show e++instance ToText ProjectionType where+ toText = \case+ All -> "ALL"+ Include -> "INCLUDE"+ KeysOnly -> "KEYS_ONLY"++instance ToByteString ProjectionType+instance ToHeader ProjectionType+instance ToQuery ProjectionType++instance FromJSON ProjectionType where+ parseJSON = parseJSONText "ProjectionType"++instance ToJSON ProjectionType where+ toJSON = toJSONText++data TableDescription = TableDescription+ { _tdAttributeDefinitions :: List "AttributeDefinitions" AttributeDefinition+ , _tdCreationDateTime :: Maybe ISO8601+ , _tdGlobalSecondaryIndexes :: List "GlobalSecondaryIndexes" GlobalSecondaryIndexDescription+ , _tdItemCount :: Maybe Integer+ , _tdKeySchema :: List1 "KeySchema" KeySchemaElement+ , _tdLocalSecondaryIndexes :: List "LocalSecondaryIndexes" LocalSecondaryIndexDescription+ , _tdProvisionedThroughput :: Maybe ProvisionedThroughputDescription+ , _tdTableName :: Maybe Text+ , _tdTableSizeBytes :: Maybe Integer+ , _tdTableStatus :: Maybe TableStatus+ } deriving (Eq, Show)++-- | 'TableDescription' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'tdAttributeDefinitions' @::@ ['AttributeDefinition']+--+-- * 'tdCreationDateTime' @::@ 'Maybe' 'UTCTime'+--+-- * 'tdGlobalSecondaryIndexes' @::@ ['GlobalSecondaryIndexDescription']+--+-- * 'tdItemCount' @::@ 'Maybe' 'Integer'+--+-- * 'tdKeySchema' @::@ 'NonEmpty' 'KeySchemaElement'+--+-- * 'tdLocalSecondaryIndexes' @::@ ['LocalSecondaryIndexDescription']+--+-- * 'tdProvisionedThroughput' @::@ 'Maybe' 'ProvisionedThroughputDescription'+--+-- * 'tdTableName' @::@ 'Maybe' 'Text'+--+-- * 'tdTableSizeBytes' @::@ 'Maybe' 'Integer'+--+-- * 'tdTableStatus' @::@ 'Maybe' 'TableStatus'+--+tableDescription :: NonEmpty KeySchemaElement -- ^ 'tdKeySchema'+ -> TableDescription+tableDescription p1 = TableDescription+ { _tdKeySchema = withIso _List1 (const id) p1+ , _tdAttributeDefinitions = mempty+ , _tdTableName = Nothing+ , _tdTableStatus = Nothing+ , _tdCreationDateTime = Nothing+ , _tdProvisionedThroughput = Nothing+ , _tdTableSizeBytes = Nothing+ , _tdItemCount = Nothing+ , _tdLocalSecondaryIndexes = mempty+ , _tdGlobalSecondaryIndexes = mempty+ }++-- | An array of /AttributeDefinition/ objects. Each of these objects describes one+-- attribute in the table and index key schema.+--+-- Each /AttributeDefinition/ object in this array is composed of:+--+-- /AttributeName/ - The name of the attribute.+--+-- /AttributeType/ - The data type for the attribute.+--+--+tdAttributeDefinitions :: Lens' TableDescription [AttributeDefinition]+tdAttributeDefinitions =+ lens _tdAttributeDefinitions (\s a -> s { _tdAttributeDefinitions = a })+ . _List++-- | The date and time when the table was created, in <http://www.epochconverter.com/ UNIX epoch time> format.+tdCreationDateTime :: Lens' TableDescription (Maybe UTCTime)+tdCreationDateTime =+ lens _tdCreationDateTime (\s a -> s { _tdCreationDateTime = a })+ . mapping _Time++-- | The global secondary indexes, if any, on the table. Each index is scoped to a+-- given hash key value. Each element is composed of:+--+-- /IndexName/ - The name of the global secondary index.+--+-- /IndexSizeBytes/ - The total size of the global secondary index, in bytes.+-- DynamoDB updates this value approximately every six hours. Recent changes+-- might not be reflected in this value.+--+-- /IndexStatus/ - The current status of the global secondary index:+--+-- /CREATING/ - The index is being created.+--+-- /UPDATING/ - The index is being updated.+--+-- /DELETING/ - The index is being deleted.+--+-- /ACTIVE/ - The index is ready for use.+--+-- /ItemCount/ - The number of items in the global secondary index. DynamoDB+-- updates this value approximately every six hours. Recent changes might not be+-- reflected in this value.+--+-- /KeySchema/ - Specifies the complete index key schema. The attribute names+-- in the key schema must be between 1 and 255 characters (inclusive). The key+-- schema must begin with the same hash key attribute as the table.+--+-- /Projection/ - Specifies attributes that are copied (projected) from the+-- table into the index. These are in addition to the primary key attributes and+-- index key attributes, which are automatically projected. Each attribute+-- specification is composed of:+--+-- /ProjectionType/ - One of the following:+--+-- 'KEYS_ONLY' - Only the index and primary keys are projected into the index.+--+-- 'INCLUDE' - Only the specified table attributes are projected into the+-- index. The list of projected attributes are in /NonKeyAttributes/.+--+-- 'ALL' - All of the table attributes are projected into the index.+--+-- /NonKeyAttributes/ - A list of one or more non-key attribute names that+-- are projected into the secondary index. The total count of attributes+-- specified in /NonKeyAttributes/, summed across all of the secondary indexes,+-- must not exceed 20. If you project the same attribute into two different+-- indexes, this counts as two distinct attributes when determining the total.+--+-- /ProvisionedThroughput/ - The provisioned throughput settings for the+-- global secondary index, consisting of read and write capacity units, along+-- with data about increases and decreases.+--+-- If the table is in the 'DELETING' state, no information about indexes will+-- be returned.+tdGlobalSecondaryIndexes :: Lens' TableDescription [GlobalSecondaryIndexDescription]+tdGlobalSecondaryIndexes =+ lens _tdGlobalSecondaryIndexes+ (\s a -> s { _tdGlobalSecondaryIndexes = a })+ . _List++-- | The number of items in the specified table. DynamoDB updates this value+-- approximately every six hours. Recent changes might not be reflected in this+-- value.+tdItemCount :: Lens' TableDescription (Maybe Integer)+tdItemCount = lens _tdItemCount (\s a -> s { _tdItemCount = a })++-- | The primary key structure for the table. Each /KeySchemaElement/ consists of:+--+-- /AttributeName/ - The name of the attribute.+--+-- /KeyType/ - The key type for the attribute. Can be either 'HASH' or 'RANGE'.+--+-- For more information about primary keys, see <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html#DataModelPrimaryKey Primary Key> in the /AmazonDynamoDB Developer Guide/.+tdKeySchema :: Lens' TableDescription (NonEmpty KeySchemaElement)+tdKeySchema = lens _tdKeySchema (\s a -> s { _tdKeySchema = a }) . _List1++-- | Represents one or more local secondary indexes on the table. Each index is+-- scoped to a given hash key value. Tables with one or more local secondary+-- indexes are subject to an item collection size limit, where the amount of+-- data within a given item collection cannot exceed 10 GB. Each element is+-- composed of:+--+-- /IndexName/ - The name of the local secondary index.+--+-- /KeySchema/ - Specifies the complete index key schema. The attribute names+-- in the key schema must be between 1 and 255 characters (inclusive). The key+-- schema must begin with the same hash key attribute as the table.+--+-- /Projection/ - Specifies attributes that are copied (projected) from the+-- table into the index. These are in addition to the primary key attributes and+-- index key attributes, which are automatically projected. Each attribute+-- specification is composed of:+--+-- /ProjectionType/ - One of the following:+--+-- 'KEYS_ONLY' - Only the index and primary keys are projected into the index.+--+-- 'INCLUDE' - Only the specified table attributes are projected into the+-- index. The list of projected attributes are in /NonKeyAttributes/.+--+-- 'ALL' - All of the table attributes are projected into the index.+--+-- /NonKeyAttributes/ - A list of one or more non-key attribute names that+-- are projected into the secondary index. The total count of attributes+-- specified in /NonKeyAttributes/, summed across all of the secondary indexes,+-- must not exceed 20. If you project the same attribute into two different+-- indexes, this counts as two distinct attributes when determining the total.+--+-- /IndexSizeBytes/ - Represents the total size of the index, in bytes.+-- DynamoDB updates this value approximately every six hours. Recent changes+-- might not be reflected in this value.+--+-- /ItemCount/ - Represents the number of items in the index. DynamoDB updates+-- this value approximately every six hours. Recent changes might not be+-- reflected in this value.+--+-- If the table is in the 'DELETING' state, no information about indexes will+-- be returned.+tdLocalSecondaryIndexes :: Lens' TableDescription [LocalSecondaryIndexDescription]+tdLocalSecondaryIndexes =+ lens _tdLocalSecondaryIndexes (\s a -> s { _tdLocalSecondaryIndexes = a })+ . _List++-- | The provisioned throughput settings for the table, consisting of read and+-- write capacity units, along with data about increases and decreases.+tdProvisionedThroughput :: Lens' TableDescription (Maybe ProvisionedThroughputDescription)+tdProvisionedThroughput =+ lens _tdProvisionedThroughput (\s a -> s { _tdProvisionedThroughput = a })++-- | The name of the table.+tdTableName :: Lens' TableDescription (Maybe Text)+tdTableName = lens _tdTableName (\s a -> s { _tdTableName = a })++-- | The total size of the specified table, in bytes. DynamoDB updates this value+-- approximately every six hours. Recent changes might not be reflected in this+-- value.+tdTableSizeBytes :: Lens' TableDescription (Maybe Integer)+tdTableSizeBytes = lens _tdTableSizeBytes (\s a -> s { _tdTableSizeBytes = a })++-- | The current state of the table:+--+-- /CREATING/ - The table is being created, as the result of a /CreateTable/+-- operation.+--+-- /UPDATING/ - The table is being updated, as the result of an /UpdateTable/+-- operation.+--+-- /DELETING/ - The table is being deleted, as the result of a /DeleteTable/+-- operation.+--+-- /ACTIVE/ - The table is ready for use.+--+--+tdTableStatus :: Lens' TableDescription (Maybe TableStatus)+tdTableStatus = lens _tdTableStatus (\s a -> s { _tdTableStatus = a })++instance FromJSON TableDescription where+ parseJSON = withObject "TableDescription" $ \o -> TableDescription+ <$> o .: "AttributeDefinitions"+ <*> o .:? "CreationDateTime"+ <*> o .: "GlobalSecondaryIndexes"+ <*> o .:? "ItemCount"+ <*> o .: "KeySchema"+ <*> o .: "LocalSecondaryIndexes"+ <*> o .:? "ProvisionedThroughput"+ <*> o .:? "TableName"+ <*> o .:? "TableSizeBytes"+ <*> o .:? "TableStatus"++instance ToJSON TableDescription where+ toJSON TableDescription{..} = object+ [ "AttributeDefinitions" .= _tdAttributeDefinitions+ , "TableName" .= _tdTableName+ , "KeySchema" .= _tdKeySchema+ , "TableStatus" .= _tdTableStatus+ , "CreationDateTime" .= _tdCreationDateTime+ , "ProvisionedThroughput" .= _tdProvisionedThroughput+ , "TableSizeBytes" .= _tdTableSizeBytes+ , "ItemCount" .= _tdItemCount+ , "LocalSecondaryIndexes" .= _tdLocalSecondaryIndexes+ , "GlobalSecondaryIndexes" .= _tdGlobalSecondaryIndexes+ ]++data KeysAndAttributes = KeysAndAttributes+ { _kaaAttributesToGet :: List1 "AttributesToGet" Text+ , _kaaConsistentRead :: Maybe Bool+ , _kaaExpressionAttributeNames :: Map Text Text+ , _kaaKeys :: List1 "Keys" (Map Text AttributeValue)+ , _kaaProjectionExpression :: Maybe Text+ } deriving (Eq, Show)++-- | 'KeysAndAttributes' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'kaaAttributesToGet' @::@ 'NonEmpty' 'Text'+--+-- * 'kaaConsistentRead' @::@ 'Maybe' 'Bool'+--+-- * 'kaaExpressionAttributeNames' @::@ 'HashMap' 'Text' 'Text'+--+-- * 'kaaKeys' @::@ 'NonEmpty' ('HashMap' 'Text' 'AttributeValue')+--+-- * 'kaaProjectionExpression' @::@ 'Maybe' 'Text'+--+keysAndAttributes :: NonEmpty (HashMap Text AttributeValue) -- ^ 'kaaKeys'+ -> NonEmpty Text -- ^ 'kaaAttributesToGet'+ -> KeysAndAttributes+keysAndAttributes p1 p2 = KeysAndAttributes+ { _kaaKeys = withIso _List1 (const id) p1+ , _kaaAttributesToGet = withIso _List1 (const id) p2+ , _kaaConsistentRead = Nothing+ , _kaaProjectionExpression = Nothing+ , _kaaExpressionAttributeNames = mempty+ }++-- | One or more attributes to retrieve from the table or index. If no attribute+-- names are specified then all attributes will be returned. If any of the+-- specified attributes are not found, they will not appear in the result.+kaaAttributesToGet :: Lens' KeysAndAttributes (NonEmpty Text)+kaaAttributesToGet =+ lens _kaaAttributesToGet (\s a -> s { _kaaAttributesToGet = a })+ . _List1++-- | The consistency of a read operation. If set to 'true', then a strongly+-- consistent read is used; otherwise, an eventually consistent read is used.+kaaConsistentRead :: Lens' KeysAndAttributes (Maybe Bool)+kaaConsistentRead =+ 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:+--+-- To shorten an attribute name that is very long or unwieldy in an+-- expression.+--+-- To create a placeholder for repeating occurrences of an attribute name in+-- an expression.+--+-- To prevent special characters in an attribute name from being+-- misinterpreted in an expression.+--+-- Use the # character in an expression to dereference an attribute name. For+-- example, consider the following expression:+--+-- 'order.customerInfo.LastName = "Smith" OR order.customerInfo.LastName ="Jones"'+--+-- Now suppose that you specified the following for /ExpressionAttributeNames/:+--+-- '{"n":"order.customerInfo.LastName"}'+--+-- The expression can now be simplified as follows:+--+-- '#n = "Smith" OR #n = "Jones"'+--+kaaExpressionAttributeNames :: Lens' KeysAndAttributes (HashMap Text Text)+kaaExpressionAttributeNames =+ lens _kaaExpressionAttributeNames+ (\s a -> s { _kaaExpressionAttributeNames = a })+ . _Map++-- | The primary key attribute values that define the items and the attributes+-- associated with the items.+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.+--+-- 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.+kaaProjectionExpression :: Lens' KeysAndAttributes (Maybe Text)+kaaProjectionExpression =+ lens _kaaProjectionExpression (\s a -> s { _kaaProjectionExpression = a })++instance FromJSON KeysAndAttributes where+ parseJSON = withObject "KeysAndAttributes" $ \o -> KeysAndAttributes+ <$> o .: "AttributesToGet"+ <*> o .:? "ConsistentRead"+ <*> o .: "ExpressionAttributeNames"+ <*> o .: "Keys"+ <*> o .:? "ProjectionExpression"++instance ToJSON KeysAndAttributes where+ toJSON KeysAndAttributes{..} = object+ [ "Keys" .= _kaaKeys+ , "AttributesToGet" .= _kaaAttributesToGet+ , "ConsistentRead" .= _kaaConsistentRead+ , "ProjectionExpression" .= _kaaProjectionExpression+ , "ExpressionAttributeNames" .= _kaaExpressionAttributeNames+ ]++data ReturnConsumedCapacity+ = Indexes -- ^ INDEXES+ | None -- ^ NONE+ | Total -- ^ TOTAL+ deriving (Eq, Ord, Show, Generic, Enum)++instance Hashable ReturnConsumedCapacity++instance FromText ReturnConsumedCapacity where+ parser = takeText >>= \case+ "INDEXES" -> pure Indexes+ "NONE" -> pure None+ "TOTAL" -> pure Total+ e -> fail $+ "Failure parsing ReturnConsumedCapacity from " ++ show e++instance ToText ReturnConsumedCapacity where+ toText = \case+ Indexes -> "INDEXES"+ None -> "NONE"+ Total -> "TOTAL"++instance ToByteString ReturnConsumedCapacity+instance ToHeader ReturnConsumedCapacity+instance ToQuery ReturnConsumedCapacity++instance FromJSON ReturnConsumedCapacity where+ parseJSON = parseJSONText "ReturnConsumedCapacity"++instance ToJSON ReturnConsumedCapacity where+ toJSON = toJSONText++data ReturnItemCollectionMetrics+ = RICMNone -- ^ NONE+ | RICMSize -- ^ SIZE+ deriving (Eq, Ord, Show, Generic, Enum)++instance Hashable ReturnItemCollectionMetrics++instance FromText ReturnItemCollectionMetrics where+ parser = takeText >>= \case+ "NONE" -> pure RICMNone+ "SIZE" -> pure RICMSize+ e -> fail $+ "Failure parsing ReturnItemCollectionMetrics from " ++ show e++instance ToText ReturnItemCollectionMetrics where+ toText = \case+ RICMNone -> "NONE"+ RICMSize -> "SIZE"++instance ToByteString ReturnItemCollectionMetrics+instance ToHeader ReturnItemCollectionMetrics+instance ToQuery ReturnItemCollectionMetrics++instance FromJSON ReturnItemCollectionMetrics where+ parseJSON = parseJSONText "ReturnItemCollectionMetrics"++instance ToJSON ReturnItemCollectionMetrics where+ toJSON = toJSONText++data AttributeValueUpdate = AttributeValueUpdate+ { _avuAction :: Maybe AttributeAction+ , _avuValue :: Maybe AttributeValue+ } deriving (Eq, Show)++-- | 'AttributeValueUpdate' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'avuAction' @::@ 'Maybe' 'AttributeAction'+--+-- * 'avuValue' @::@ 'Maybe' 'AttributeValue'+--+attributeValueUpdate :: AttributeValueUpdate+attributeValueUpdate = AttributeValueUpdate+ { _avuValue = Nothing+ , _avuAction = Nothing+ }++-- | Specifies how to perform the update. Valid values are 'PUT' (default), 'DELETE',+-- and 'ADD'. The behavior depends on whether the specified primary key already+-- exists in the table.+--+-- If an item with the specified /Key/ is found in the table:+--+-- 'PUT' - Adds the specified attribute to the item. If the attribute already+-- exists, it is replaced by the new value.+--+-- 'DELETE' - If no value is specified, the attribute and its value are removed+-- from the item. The data type of the specified value must match the existing+-- value's data type.+--+-- If a /set/ of values is specified, then those values are subtracted from the+-- old set. For example, if the attribute value was the set '[a,b,c]' and the /DELETE/ action specified '[a,c]', then the final attribute value would be '[b]'.+-- Specifying an empty set is an error.+--+-- 'ADD' - If the attribute does not already exist, then the attribute and its+-- values are added to the item. If the attribute does exist, then the behavior+-- of 'ADD' depends on the data type of the attribute:+--+-- If the existing attribute is a number, and if /Value/ is also a number, then+-- the /Value/ is mathematically added to the existing attribute. If /Value/ is a+-- negative number, then it is subtracted from the existing attribute.+--+-- 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+-- 'ADD' action specified '[3]', then the final attribute value would be '[1,2,3]'. An+-- error occurs if an Add action is specified for a set attribute and the+-- attribute type specified does not match the existing set type.+--+-- Both sets must have the same primitive data type. For example, if the+-- existing data type is a set of strings, the /Value/ must also be a set of+-- strings. The same holds true for number sets and binary sets.+--+-- This action is only valid for an existing attribute whose data type is+-- number or is a set. Do not use 'ADD' for any other data types.+--+-- If no item with the specified /Key/ is found:+--+-- 'PUT' - DynamoDB creates a new item with the specified primary key, and then+-- adds the attribute.+--+-- 'DELETE' - Nothing happens; there is no attribute to delete.+--+-- 'ADD' - DynamoDB creates 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; no other data types can be specified.+--+--+avuAction :: Lens' AttributeValueUpdate (Maybe AttributeAction)+avuAction = lens _avuAction (\s a -> s { _avuAction = a })++avuValue :: Lens' AttributeValueUpdate (Maybe AttributeValue)+avuValue = lens _avuValue (\s a -> s { _avuValue = a })++instance FromJSON AttributeValueUpdate where+ parseJSON = withObject "AttributeValueUpdate" $ \o -> AttributeValueUpdate+ <$> o .:? "Action"+ <*> o .:? "Value"++instance ToJSON AttributeValueUpdate where+ toJSON AttributeValueUpdate{..} = object+ [ "Value" .= _avuValue+ , "Action" .= _avuAction+ ]++data ExpectedAttributeValue = ExpectedAttributeValue+ { _eavAttributeValueList :: List "AttributeValueList" AttributeValue+ , _eavComparisonOperator :: Maybe ComparisonOperator+ , _eavExists :: Maybe Bool+ , _eavValue :: Maybe AttributeValue+ } deriving (Eq, Show)++-- | 'ExpectedAttributeValue' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'eavAttributeValueList' @::@ ['AttributeValue']+--+-- * 'eavComparisonOperator' @::@ 'Maybe' 'ComparisonOperator'+--+-- * 'eavExists' @::@ 'Maybe' 'Bool'+--+-- * 'eavValue' @::@ 'Maybe' 'AttributeValue'+--+expectedAttributeValue :: ExpectedAttributeValue+expectedAttributeValue = ExpectedAttributeValue+ { _eavValue = Nothing+ , _eavExists = Nothing+ , _eavComparisonOperator = Nothing+ , _eavAttributeValueList = mempty+ }++-- | One or more values to evaluate against the supplied attribute. The number of+-- values in the list depends on the /ComparisonOperator/ being used.+--+-- 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+-- 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+-- compares binary values, for example when evaluating query expressions.+--+-- For information on specifying data types in JSON, see <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataFormat.html JSON Data Format> in+-- the /Amazon DynamoDB Developer Guide/.+eavAttributeValueList :: Lens' ExpectedAttributeValue [AttributeValue]+eavAttributeValueList =+ lens _eavAttributeValueList (\s a -> s { _eavAttributeValueList = a })+ . _List++-- | A comparator for evaluating attributes in the /AttributeValueList/. For+-- example, equals, greater than, less than, etc.+--+-- The following comparison operators are available:+--+-- 'EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS |BEGINS_WITH | IN | BETWEEN'+--+-- The following are descriptions of each comparison operator.+--+-- 'EQ' : Equal. 'EQ' is supported for all datatypes, including lists and maps.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, Binary, String Set, Number Set, or Binary Set. If an item+-- contains an /AttributeValue/ element of a different type than the one specified+-- in the request, the value does not match. For example, '{"S":"6"}' does not+-- equal '{"N":"6"}'. Also, '{"N":"6"}' does not equal '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'NE' : Not equal. 'NE' is supported for all datatypes, including lists and+-- maps.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ of type String,+-- Number, Binary, String Set, Number Set, or Binary Set. If an item contains an /AttributeValue/ of a different type than the one specified in the request, the+-- value does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not equal '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'LE' : Less than or equal.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'LT' : Less than.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ of type String,+-- Number, or Binary (not a set type). If an item contains an /AttributeValue/+-- element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'GE' : Greater than or equal.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'GT' : Greater than.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'NOT_NULL' : The attribute exists. 'NOT_NULL' is supported for all datatypes,+-- including lists and maps.+--+-- 'NULL' : The attribute does not exist. 'NULL' is supported for all datatypes,+-- including lists and maps.+--+-- 'CONTAINS' : Checks for a subsequence, or value in a set.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If the target attribute of the+-- comparison is of type String, then the operator checks for a substring match.+-- If the target attribute of the comparison is of type Binary, then the+-- operator looks for a subsequence of the target that matches the input. If the+-- target attribute of the comparison is a set ("'SS'", "'NS'", or "'BS'"), then the+-- operator evaluates to true if it finds an exact match with any member of the+-- set.+--+-- CONTAINS is supported for lists: When evaluating "'a CONTAINS b'", "'a'" can be+-- a list; however, "'b'" cannot be a set, a map, or a list.+--+-- 'NOT_CONTAINS' : Checks for absence of a subsequence, or absence of a value+-- in a set.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If the target attribute of the+-- comparison is a String, then the operator checks for the absence of a+-- substring match. If the target attribute of the comparison is Binary, then+-- the operator checks for the absence of a subsequence of the target that+-- matches the input. If the target attribute of the comparison is a set ("'SS'", "'NS'", or "'BS'"), then the operator evaluates to true if it /does not/ find an+-- exact match with any member of the set.+--+-- NOT_CONTAINS is supported for lists: When evaluating "'a NOT CONTAINS b'", "'a'"+-- can be a list; however, "'b'" cannot be a set, a map, or a list.+--+-- 'BEGINS_WITH' : Checks for a prefix.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ of type String or+-- Binary (not a Number or a set type). The target attribute of the comparison+-- must be of type String or Binary (not a Number or a set type).+--+--+--+-- 'IN' : Checks for matching elements within two sets.+--+-- /AttributeValueList/ can contain one or more /AttributeValue/ elements of type+-- String, Number, or Binary (not a set type). These attributes are compared+-- against an existing set type attribute of an item. If any elements of the+-- input set are present in the item attribute, the expression evaluates to true.+--+-- 'BETWEEN' : Greater than or equal to the first value, and less than or equal+-- to the second value.+--+-- /AttributeValueList/ must contain two /AttributeValue/ elements of the same+-- type, either String, Number, or Binary (not a set type). A target attribute+-- matches if the target value is greater than, or equal to, the first element+-- and less than, or equal to, the second element. If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not compare to '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'+--+--+eavComparisonOperator :: Lens' ExpectedAttributeValue (Maybe ComparisonOperator)+eavComparisonOperator =+ lens _eavComparisonOperator (\s a -> s { _eavComparisonOperator = a })++-- | Causes DynamoDB to evaluate the value before attempting a conditional+-- operation:+--+-- If /Exists/ is 'true', DynamoDB will check to see if that attribute value+-- already exists in the table. If it is found, then the operation succeeds. If+-- it is not found, the operation fails with a /ConditionalCheckFailedException/.+--+-- If /Exists/ is 'false', DynamoDB assumes that the attribute value does not+-- exist in the table. If in fact the value does not exist, then the assumption+-- is valid and the operation succeeds. If the value is found, despite the+-- assumption that it does not exist, the operation fails with a /ConditionalCheckFailedException/.+--+-- The default setting for /Exists/ is 'true'. If you supply a /Value/ all by+-- itself, DynamoDB assumes the attribute exists: You don't have to set /Exists/+-- to 'true', because it is implied.+--+-- DynamoDB returns a /ValidationException/ if:+--+-- /Exists/ is 'true' but there is no /Value/ to check. (You expect a value to+-- exist, but don't specify what that value is.)+--+-- /Exists/ is 'false' but you also specify a /Value/. (You cannot expect an+-- attribute to have a value, while also expecting it not to exist.)+--+--+eavExists :: Lens' ExpectedAttributeValue (Maybe Bool)+eavExists = lens _eavExists (\s a -> s { _eavExists = a })++eavValue :: Lens' ExpectedAttributeValue (Maybe AttributeValue)+eavValue = lens _eavValue (\s a -> s { _eavValue = a })++instance FromJSON ExpectedAttributeValue where+ parseJSON = withObject "ExpectedAttributeValue" $ \o -> ExpectedAttributeValue+ <$> o .: "AttributeValueList"+ <*> o .:? "ComparisonOperator"+ <*> o .:? "Exists"+ <*> o .:? "Value"++instance ToJSON ExpectedAttributeValue where+ toJSON ExpectedAttributeValue{..} = object+ [ "Value" .= _eavValue+ , "Exists" .= _eavExists+ , "ComparisonOperator" .= _eavComparisonOperator+ , "AttributeValueList" .= _eavAttributeValueList+ ]++data AttributeDefinition = AttributeDefinition+ { _adAttributeName :: Text+ , _adAttributeType :: ScalarAttributeType+ } deriving (Eq, Show)++-- | 'AttributeDefinition' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'adAttributeName' @::@ 'Text'+--+-- * 'adAttributeType' @::@ 'ScalarAttributeType'+--+attributeDefinition :: Text -- ^ 'adAttributeName'+ -> ScalarAttributeType -- ^ 'adAttributeType'+ -> AttributeDefinition+attributeDefinition p1 p2 = AttributeDefinition+ { _adAttributeName = p1+ , _adAttributeType = p2+ }++-- | A name for the attribute.+adAttributeName :: Lens' AttributeDefinition Text+adAttributeName = lens _adAttributeName (\s a -> s { _adAttributeName = a })++-- | The data type for the attribute.+adAttributeType :: Lens' AttributeDefinition ScalarAttributeType+adAttributeType = lens _adAttributeType (\s a -> s { _adAttributeType = a })++instance FromJSON AttributeDefinition where+ parseJSON = withObject "AttributeDefinition" $ \o -> AttributeDefinition+ <$> o .: "AttributeName"+ <*> o .: "AttributeType"++instance ToJSON AttributeDefinition where+ toJSON AttributeDefinition{..} = object+ [ "AttributeName" .= _adAttributeName+ , "AttributeType" .= _adAttributeType+ ]++data ComparisonOperator+ = BeginsWith -- ^ BEGINS_WITH+ | Between -- ^ BETWEEN+ | Contains -- ^ CONTAINS+ | Eq -- ^ EQ+ | Ge -- ^ GE+ | Gt -- ^ GT+ | In' -- ^ IN+ | Le -- ^ LE+ | Lt -- ^ LT+ | Ne -- ^ NE+ | NotContains -- ^ NOT_CONTAINS+ | NotNull -- ^ NOT_NULL+ | Null -- ^ NULL+ deriving (Eq, Ord, Show, Generic, Enum)++instance Hashable ComparisonOperator++instance FromText ComparisonOperator where+ parser = takeText >>= \case+ "BEGINS_WITH" -> pure BeginsWith+ "BETWEEN" -> pure Between+ "CONTAINS" -> pure Contains+ "EQ" -> pure Eq+ "GE" -> pure Ge+ "GT" -> pure Gt+ "IN" -> pure In'+ "LE" -> pure Le+ "LT" -> pure Lt+ "NE" -> pure Ne+ "NOT_CONTAINS" -> pure NotContains+ "NOT_NULL" -> pure NotNull+ "NULL" -> pure Null+ e -> fail $+ "Failure parsing ComparisonOperator from " ++ show e++instance ToText ComparisonOperator where+ toText = \case+ BeginsWith -> "BEGINS_WITH"+ Between -> "BETWEEN"+ Contains -> "CONTAINS"+ Eq -> "EQ"+ Ge -> "GE"+ Gt -> "GT"+ In' -> "IN"+ Le -> "LE"+ Lt -> "LT"+ Ne -> "NE"+ NotContains -> "NOT_CONTAINS"+ NotNull -> "NOT_NULL"+ Null -> "NULL"++instance ToByteString ComparisonOperator+instance ToHeader ComparisonOperator+instance ToQuery ComparisonOperator++instance FromJSON ComparisonOperator where+ parseJSON = parseJSONText "ComparisonOperator"++instance ToJSON ComparisonOperator where+ toJSON = toJSONText++data ReturnValue+ = RVAllNew -- ^ ALL_NEW+ | RVAllOld -- ^ ALL_OLD+ | RVNone -- ^ NONE+ | RVUpdatedNew -- ^ UPDATED_NEW+ | RVUpdatedOld -- ^ UPDATED_OLD+ deriving (Eq, Ord, Show, Generic, Enum)++instance Hashable ReturnValue++instance FromText ReturnValue where+ parser = takeText >>= \case+ "ALL_NEW" -> pure RVAllNew+ "ALL_OLD" -> pure RVAllOld+ "NONE" -> pure RVNone+ "UPDATED_NEW" -> pure RVUpdatedNew+ "UPDATED_OLD" -> pure RVUpdatedOld+ e -> fail $+ "Failure parsing ReturnValue from " ++ show e++instance ToText ReturnValue where+ toText = \case+ RVAllNew -> "ALL_NEW"+ RVAllOld -> "ALL_OLD"+ RVNone -> "NONE"+ RVUpdatedNew -> "UPDATED_NEW"+ RVUpdatedOld -> "UPDATED_OLD"++instance ToByteString ReturnValue+instance ToHeader ReturnValue+instance ToQuery ReturnValue++instance FromJSON ReturnValue where+ parseJSON = parseJSONText "ReturnValue"++instance ToJSON ReturnValue where+ toJSON = toJSONText++data LocalSecondaryIndex = LocalSecondaryIndex+ { _lsiIndexName :: Text+ , _lsiKeySchema :: List1 "KeySchema" KeySchemaElement+ , _lsiProjection :: Projection+ } deriving (Eq, Show)++-- | 'LocalSecondaryIndex' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'lsiIndexName' @::@ 'Text'+--+-- * 'lsiKeySchema' @::@ 'NonEmpty' 'KeySchemaElement'+--+-- * 'lsiProjection' @::@ 'Projection'+--+localSecondaryIndex :: Text -- ^ 'lsiIndexName'+ -> NonEmpty KeySchemaElement -- ^ 'lsiKeySchema'+ -> Projection -- ^ 'lsiProjection'+ -> LocalSecondaryIndex+localSecondaryIndex p1 p2 p3 = LocalSecondaryIndex+ { _lsiIndexName = p1+ , _lsiKeySchema = withIso _List1 (const id) p2+ , _lsiProjection = p3+ }++-- | The name of the local secondary index. The name must be unique among all+-- other indexes on this table.+lsiIndexName :: Lens' LocalSecondaryIndex Text+lsiIndexName = lens _lsiIndexName (\s a -> s { _lsiIndexName = a })++-- | The complete key schema for the local secondary index, consisting of one or+-- more pairs of attribute names and key types ('HASH' or 'RANGE').+lsiKeySchema :: Lens' LocalSecondaryIndex (NonEmpty KeySchemaElement)+lsiKeySchema = lens _lsiKeySchema (\s a -> s { _lsiKeySchema = a }) . _List1++lsiProjection :: Lens' LocalSecondaryIndex Projection+lsiProjection = lens _lsiProjection (\s a -> s { _lsiProjection = a })++instance FromJSON LocalSecondaryIndex where+ parseJSON = withObject "LocalSecondaryIndex" $ \o -> LocalSecondaryIndex+ <$> o .: "IndexName"+ <*> o .: "KeySchema"+ <*> o .: "Projection"++instance ToJSON LocalSecondaryIndex where+ toJSON LocalSecondaryIndex{..} = object+ [ "IndexName" .= _lsiIndexName+ , "KeySchema" .= _lsiKeySchema+ , "Projection" .= _lsiProjection+ ]++data GlobalSecondaryIndexDescription = GlobalSecondaryIndexDescription+ { _gsidIndexName :: Maybe Text+ , _gsidIndexSizeBytes :: Maybe Integer+ , _gsidIndexStatus :: Maybe IndexStatus+ , _gsidItemCount :: Maybe Integer+ , _gsidKeySchema :: List1 "KeySchema" KeySchemaElement+ , _gsidProjection :: Maybe Projection+ , _gsidProvisionedThroughput :: Maybe ProvisionedThroughputDescription+ } deriving (Eq, Show)++-- | 'GlobalSecondaryIndexDescription' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gsidIndexName' @::@ 'Maybe' 'Text'+--+-- * 'gsidIndexSizeBytes' @::@ 'Maybe' 'Integer'+--+-- * 'gsidIndexStatus' @::@ 'Maybe' 'IndexStatus'+--+-- * 'gsidItemCount' @::@ 'Maybe' 'Integer'+--+-- * 'gsidKeySchema' @::@ 'NonEmpty' 'KeySchemaElement'+--+-- * 'gsidProjection' @::@ 'Maybe' 'Projection'+--+-- * 'gsidProvisionedThroughput' @::@ 'Maybe' 'ProvisionedThroughputDescription'+--+globalSecondaryIndexDescription :: NonEmpty KeySchemaElement -- ^ 'gsidKeySchema'+ -> GlobalSecondaryIndexDescription+globalSecondaryIndexDescription p1 = GlobalSecondaryIndexDescription+ { _gsidKeySchema = withIso _List1 (const id) p1+ , _gsidIndexName = Nothing+ , _gsidProjection = Nothing+ , _gsidIndexStatus = Nothing+ , _gsidProvisionedThroughput = Nothing+ , _gsidIndexSizeBytes = Nothing+ , _gsidItemCount = Nothing+ }++-- | The name of the global secondary index.+gsidIndexName :: Lens' GlobalSecondaryIndexDescription (Maybe Text)+gsidIndexName = lens _gsidIndexName (\s a -> s { _gsidIndexName = a })++-- | The total size of the specified index, in bytes. DynamoDB updates this value+-- approximately every six hours. Recent changes might not be reflected in this+-- value.+gsidIndexSizeBytes :: Lens' GlobalSecondaryIndexDescription (Maybe Integer)+gsidIndexSizeBytes =+ lens _gsidIndexSizeBytes (\s a -> s { _gsidIndexSizeBytes = a })++-- | The current state of the global secondary index:+--+-- /CREATING/ - The index is being created, as the result of a /CreateTable/ or /UpdateTable/ operation.+--+-- /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.+--+-- /ACTIVE/ - The index is ready for use.+--+--+gsidIndexStatus :: Lens' GlobalSecondaryIndexDescription (Maybe IndexStatus)+gsidIndexStatus = lens _gsidIndexStatus (\s a -> s { _gsidIndexStatus = a })++-- | The number of items in the specified index. DynamoDB updates this value+-- approximately every six hours. Recent changes might not be reflected in this+-- value.+gsidItemCount :: Lens' GlobalSecondaryIndexDescription (Maybe Integer)+gsidItemCount = lens _gsidItemCount (\s a -> s { _gsidItemCount = a })++-- | The complete key schema for the global secondary index, consisting of one or+-- more pairs of attribute names and key types ('HASH' or 'RANGE').+gsidKeySchema :: Lens' GlobalSecondaryIndexDescription (NonEmpty KeySchemaElement)+gsidKeySchema = lens _gsidKeySchema (\s a -> s { _gsidKeySchema = a }) . _List1++gsidProjection :: Lens' GlobalSecondaryIndexDescription (Maybe Projection)+gsidProjection = lens _gsidProjection (\s a -> s { _gsidProjection = a })++gsidProvisionedThroughput :: Lens' GlobalSecondaryIndexDescription (Maybe ProvisionedThroughputDescription)+gsidProvisionedThroughput =+ lens _gsidProvisionedThroughput+ (\s a -> s { _gsidProvisionedThroughput = a })++instance FromJSON GlobalSecondaryIndexDescription where+ parseJSON = withObject "GlobalSecondaryIndexDescription" $ \o -> GlobalSecondaryIndexDescription+ <$> o .:? "IndexName"+ <*> o .:? "IndexSizeBytes"+ <*> o .:? "IndexStatus"+ <*> o .:? "ItemCount"+ <*> o .: "KeySchema"+ <*> o .:? "Projection"+ <*> o .:? "ProvisionedThroughput"++instance ToJSON GlobalSecondaryIndexDescription where+ toJSON GlobalSecondaryIndexDescription{..} = object+ [ "IndexName" .= _gsidIndexName+ , "KeySchema" .= _gsidKeySchema+ , "Projection" .= _gsidProjection+ , "IndexStatus" .= _gsidIndexStatus+ , "ProvisionedThroughput" .= _gsidProvisionedThroughput+ , "IndexSizeBytes" .= _gsidIndexSizeBytes+ , "ItemCount" .= _gsidItemCount+ ]++data ItemCollectionMetrics = ItemCollectionMetrics+ { _icmItemCollectionKey :: Map Text AttributeValue+ , _icmSizeEstimateRangeGB :: List "SizeEstimateRangeGB" Double+ } deriving (Eq, Show)++-- | 'ItemCollectionMetrics' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'icmItemCollectionKey' @::@ 'HashMap' 'Text' 'AttributeValue'+--+-- * 'icmSizeEstimateRangeGB' @::@ ['Double']+--+itemCollectionMetrics :: ItemCollectionMetrics+itemCollectionMetrics = ItemCollectionMetrics+ { _icmItemCollectionKey = mempty+ , _icmSizeEstimateRangeGB = mempty+ }++-- | The hash key value of the item collection. This value is the same as the hash+-- key of the item.+icmItemCollectionKey :: Lens' ItemCollectionMetrics (HashMap Text AttributeValue)+icmItemCollectionKey =+ lens _icmItemCollectionKey (\s a -> s { _icmItemCollectionKey = a })+ . _Map++-- | An estimate of item collection size, in gigabytes. This value is a+-- two-element array containing a lower bound and an upper bound for the+-- estimate. The estimate includes the size of all the items in the table, plus+-- the size of all attributes projected into all of the local secondary indexes+-- on that table. Use this estimate to measure whether a local secondary index+-- is approaching its size limit.+--+-- The estimate is subject to change over time; therefore, do not rely on the+-- precision or accuracy of the estimate.+icmSizeEstimateRangeGB :: Lens' ItemCollectionMetrics [Double]+icmSizeEstimateRangeGB =+ lens _icmSizeEstimateRangeGB (\s a -> s { _icmSizeEstimateRangeGB = a })+ . _List++instance FromJSON ItemCollectionMetrics where+ parseJSON = withObject "ItemCollectionMetrics" $ \o -> ItemCollectionMetrics+ <$> o .: "ItemCollectionKey"+ <*> o .: "SizeEstimateRangeGB"++instance ToJSON ItemCollectionMetrics where+ toJSON ItemCollectionMetrics{..} = object+ [ "ItemCollectionKey" .= _icmItemCollectionKey+ , "SizeEstimateRangeGB" .= _icmSizeEstimateRangeGB+ ]++newtype Capacity = Capacity+ { _cCapacityUnits :: Maybe Double+ } deriving (Eq, Ord, Show)++-- | 'Capacity' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'cCapacityUnits' @::@ 'Maybe' 'Double'+--+capacity :: Capacity+capacity = Capacity+ { _cCapacityUnits = Nothing+ }++-- | The total number of capacity units consumed on a table or an index.+cCapacityUnits :: Lens' Capacity (Maybe Double)+cCapacityUnits = lens _cCapacityUnits (\s a -> s { _cCapacityUnits = a })++instance FromJSON Capacity where+ parseJSON = withObject "Capacity" $ \o -> Capacity+ <$> o .:? "CapacityUnits"++instance ToJSON Capacity where+ toJSON Capacity{..} = object+ [ "CapacityUnits" .= _cCapacityUnits+ ]++data ConsumedCapacity = ConsumedCapacity+ { _ccCapacityUnits :: Maybe Double+ , _ccGlobalSecondaryIndexes :: Map Text Capacity+ , _ccLocalSecondaryIndexes :: Map Text Capacity+ , _ccTable :: Maybe Capacity+ , _ccTableName :: Maybe Text+ } deriving (Eq, Show)++-- | 'ConsumedCapacity' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'ccCapacityUnits' @::@ 'Maybe' 'Double'+--+-- * 'ccGlobalSecondaryIndexes' @::@ 'HashMap' 'Text' 'Capacity'+--+-- * 'ccLocalSecondaryIndexes' @::@ 'HashMap' 'Text' 'Capacity'+--+-- * 'ccTable' @::@ 'Maybe' 'Capacity'+--+-- * 'ccTableName' @::@ 'Maybe' 'Text'+--+consumedCapacity :: ConsumedCapacity+consumedCapacity = ConsumedCapacity+ { _ccTableName = Nothing+ , _ccCapacityUnits = Nothing+ , _ccTable = Nothing+ , _ccLocalSecondaryIndexes = mempty+ , _ccGlobalSecondaryIndexes = mempty+ }++-- | The total number of capacity units consumed by the operation.+ccCapacityUnits :: Lens' ConsumedCapacity (Maybe Double)+ccCapacityUnits = lens _ccCapacityUnits (\s a -> s { _ccCapacityUnits = a })++-- | The amount of throughput consumed on each global index affected by the+-- operation.+ccGlobalSecondaryIndexes :: Lens' ConsumedCapacity (HashMap Text Capacity)+ccGlobalSecondaryIndexes =+ lens _ccGlobalSecondaryIndexes+ (\s a -> s { _ccGlobalSecondaryIndexes = a })+ . _Map++-- | The amount of throughput consumed on each local index affected by the+-- operation.+ccLocalSecondaryIndexes :: Lens' ConsumedCapacity (HashMap Text Capacity)+ccLocalSecondaryIndexes =+ lens _ccLocalSecondaryIndexes (\s a -> s { _ccLocalSecondaryIndexes = a })+ . _Map++-- | The amount of throughput consumed on the table affected by the operation.+ccTable :: Lens' ConsumedCapacity (Maybe Capacity)+ccTable = lens _ccTable (\s a -> s { _ccTable = a })++-- | The name of the table that was affected by the operation.+ccTableName :: Lens' ConsumedCapacity (Maybe Text)+ccTableName = lens _ccTableName (\s a -> s { _ccTableName = a })++instance FromJSON ConsumedCapacity where+ parseJSON = withObject "ConsumedCapacity" $ \o -> ConsumedCapacity+ <$> o .:? "CapacityUnits"+ <*> o .: "GlobalSecondaryIndexes"+ <*> o .: "LocalSecondaryIndexes"+ <*> o .:? "Table"+ <*> o .:? "TableName"++instance ToJSON ConsumedCapacity where+ toJSON ConsumedCapacity{..} = object+ [ "TableName" .= _ccTableName+ , "CapacityUnits" .= _ccCapacityUnits+ , "Table" .= _ccTable+ , "LocalSecondaryIndexes" .= _ccLocalSecondaryIndexes+ , "GlobalSecondaryIndexes" .= _ccGlobalSecondaryIndexes+ ]++data GlobalSecondaryIndex = GlobalSecondaryIndex+ { _gsiIndexName :: Text+ , _gsiKeySchema :: List1 "KeySchema" KeySchemaElement+ , _gsiProjection :: Projection+ , _gsiProvisionedThroughput :: ProvisionedThroughput+ } deriving (Eq, Show)++-- | 'GlobalSecondaryIndex' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gsiIndexName' @::@ 'Text'+--+-- * 'gsiKeySchema' @::@ 'NonEmpty' 'KeySchemaElement'+--+-- * 'gsiProjection' @::@ 'Projection'+--+-- * 'gsiProvisionedThroughput' @::@ 'ProvisionedThroughput'+--+globalSecondaryIndex :: Text -- ^ 'gsiIndexName'+ -> NonEmpty KeySchemaElement -- ^ 'gsiKeySchema'+ -> Projection -- ^ 'gsiProjection'+ -> ProvisionedThroughput -- ^ 'gsiProvisionedThroughput'+ -> GlobalSecondaryIndex+globalSecondaryIndex p1 p2 p3 p4 = GlobalSecondaryIndex+ { _gsiIndexName = p1+ , _gsiKeySchema = withIso _List1 (const id) p2+ , _gsiProjection = p3+ , _gsiProvisionedThroughput = p4+ }++-- | The name of the global secondary index. The name must be unique among all+-- other indexes on this table.+gsiIndexName :: Lens' GlobalSecondaryIndex Text+gsiIndexName = lens _gsiIndexName (\s a -> s { _gsiIndexName = a })++-- | The complete key schema for a global secondary index, which consists of one+-- or more pairs of attribute names and key types ('HASH' or 'RANGE').+gsiKeySchema :: Lens' GlobalSecondaryIndex (NonEmpty KeySchemaElement)+gsiKeySchema = lens _gsiKeySchema (\s a -> s { _gsiKeySchema = a }) . _List1++gsiProjection :: Lens' GlobalSecondaryIndex Projection+gsiProjection = lens _gsiProjection (\s a -> s { _gsiProjection = a })++gsiProvisionedThroughput :: Lens' GlobalSecondaryIndex ProvisionedThroughput+gsiProvisionedThroughput =+ lens _gsiProvisionedThroughput+ (\s a -> s { _gsiProvisionedThroughput = a })++instance FromJSON GlobalSecondaryIndex where+ parseJSON = withObject "GlobalSecondaryIndex" $ \o -> GlobalSecondaryIndex+ <$> o .: "IndexName"+ <*> o .: "KeySchema"+ <*> o .: "Projection"+ <*> o .: "ProvisionedThroughput"++instance ToJSON GlobalSecondaryIndex where+ toJSON GlobalSecondaryIndex{..} = object+ [ "IndexName" .= _gsiIndexName+ , "KeySchema" .= _gsiKeySchema+ , "Projection" .= _gsiProjection+ , "ProvisionedThroughput" .= _gsiProvisionedThroughput+ ]++data LocalSecondaryIndexDescription = LocalSecondaryIndexDescription+ { _lsidIndexName :: Maybe Text+ , _lsidIndexSizeBytes :: Maybe Integer+ , _lsidItemCount :: Maybe Integer+ , _lsidKeySchema :: List1 "KeySchema" KeySchemaElement+ , _lsidProjection :: Maybe Projection+ } deriving (Eq, Show)++-- | 'LocalSecondaryIndexDescription' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'lsidIndexName' @::@ 'Maybe' 'Text'+--+-- * 'lsidIndexSizeBytes' @::@ 'Maybe' 'Integer'+--+-- * 'lsidItemCount' @::@ 'Maybe' 'Integer'+--+-- * 'lsidKeySchema' @::@ 'NonEmpty' 'KeySchemaElement'+--+-- * 'lsidProjection' @::@ 'Maybe' 'Projection'+--+localSecondaryIndexDescription :: NonEmpty KeySchemaElement -- ^ 'lsidKeySchema'+ -> LocalSecondaryIndexDescription+localSecondaryIndexDescription p1 = LocalSecondaryIndexDescription+ { _lsidKeySchema = withIso _List1 (const id) p1+ , _lsidIndexName = Nothing+ , _lsidProjection = Nothing+ , _lsidIndexSizeBytes = Nothing+ , _lsidItemCount = Nothing+ }++-- | Represents the name of the local secondary index.+lsidIndexName :: Lens' LocalSecondaryIndexDescription (Maybe Text)+lsidIndexName = lens _lsidIndexName (\s a -> s { _lsidIndexName = a })++-- | The total size of the specified index, in bytes. DynamoDB updates this value+-- approximately every six hours. Recent changes might not be reflected in this+-- value.+lsidIndexSizeBytes :: Lens' LocalSecondaryIndexDescription (Maybe Integer)+lsidIndexSizeBytes =+ lens _lsidIndexSizeBytes (\s a -> s { _lsidIndexSizeBytes = a })++-- | The number of items in the specified index. DynamoDB updates this value+-- approximately every six hours. Recent changes might not be reflected in this+-- value.+lsidItemCount :: Lens' LocalSecondaryIndexDescription (Maybe Integer)+lsidItemCount = lens _lsidItemCount (\s a -> s { _lsidItemCount = a })++-- | The complete index key schema, which consists of one or more pairs of+-- attribute names and key types ('HASH' or 'RANGE').+lsidKeySchema :: Lens' LocalSecondaryIndexDescription (NonEmpty KeySchemaElement)+lsidKeySchema = lens _lsidKeySchema (\s a -> s { _lsidKeySchema = a }) . _List1++lsidProjection :: Lens' LocalSecondaryIndexDescription (Maybe Projection)+lsidProjection = lens _lsidProjection (\s a -> s { _lsidProjection = a })++instance FromJSON LocalSecondaryIndexDescription where+ parseJSON = withObject "LocalSecondaryIndexDescription" $ \o -> LocalSecondaryIndexDescription+ <$> o .:? "IndexName"+ <*> o .:? "IndexSizeBytes"+ <*> o .:? "ItemCount"+ <*> o .: "KeySchema"+ <*> o .:? "Projection"++instance ToJSON LocalSecondaryIndexDescription where+ toJSON LocalSecondaryIndexDescription{..} = object+ [ "IndexName" .= _lsidIndexName+ , "KeySchema" .= _lsidKeySchema+ , "Projection" .= _lsidProjection+ , "IndexSizeBytes" .= _lsidIndexSizeBytes+ , "ItemCount" .= _lsidItemCount+ ]++data AttributeAction+ = Add -- ^ ADD+ | Delete' -- ^ DELETE+ | Put -- ^ PUT+ deriving (Eq, Ord, Show, Generic, Enum)++instance Hashable AttributeAction++instance FromText AttributeAction where+ parser = takeText >>= \case+ "ADD" -> pure Add+ "DELETE" -> pure Delete'+ "PUT" -> pure Put+ e -> fail $+ "Failure parsing AttributeAction from " ++ show e++instance ToText AttributeAction where+ toText = \case+ Add -> "ADD"+ Delete' -> "DELETE"+ Put -> "PUT"++instance ToByteString AttributeAction+instance ToHeader AttributeAction+instance ToQuery AttributeAction++instance FromJSON AttributeAction where+ parseJSON = parseJSONText "AttributeAction"++instance ToJSON AttributeAction where+ toJSON = toJSONText++data ScalarAttributeType+ = B -- ^ B+ | N -- ^ N+ | S -- ^ S+ deriving (Eq, Ord, Show, Generic, Enum)++instance Hashable ScalarAttributeType++instance FromText ScalarAttributeType where+ parser = takeText >>= \case+ "B" -> pure B+ "N" -> pure N+ "S" -> pure S+ e -> fail $+ "Failure parsing ScalarAttributeType from " ++ show e++instance ToText ScalarAttributeType where+ toText = \case+ B -> "B"+ N -> "N"+ S -> "S"++instance ToByteString ScalarAttributeType+instance ToHeader ScalarAttributeType+instance ToQuery ScalarAttributeType++instance FromJSON ScalarAttributeType where+ parseJSON = parseJSONText "ScalarAttributeType"++instance ToJSON ScalarAttributeType where+ toJSON = toJSONText++data Projection = Projection+ { _pNonKeyAttributes :: List1 "NonKeyAttributes" Text+ , _pProjectionType :: Maybe ProjectionType+ } deriving (Eq, Show)++-- | 'Projection' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'pNonKeyAttributes' @::@ 'NonEmpty' 'Text'+--+-- * 'pProjectionType' @::@ 'Maybe' 'ProjectionType'+--+projection :: NonEmpty Text -- ^ 'pNonKeyAttributes'+ -> Projection+projection p1 = Projection+ { _pNonKeyAttributes = withIso _List1 (const id) p1+ , _pProjectionType = Nothing+ }++-- | Represents the non-key attribute names which will be projected into the index.+--+-- For local secondary indexes, the total count of /NonKeyAttributes/ summed+-- across all of the local secondary indexes, must not exceed 20. If you project+-- the same attribute into two different indexes, this counts as two distinct+-- attributes when determining the total.+pNonKeyAttributes :: Lens' Projection (NonEmpty Text)+pNonKeyAttributes =+ lens _pNonKeyAttributes (\s a -> s { _pNonKeyAttributes = a })+ . _List1++-- | The set of attributes that are projected into the index:+--+-- 'KEYS_ONLY' - Only the index and primary keys are projected into the index.+--+-- 'INCLUDE' - Only the specified table attributes are projected into the+-- index. The list of projected attributes are in /NonKeyAttributes/.+--+-- 'ALL' - All of the table attributes are projected into the index.+--+--+pProjectionType :: Lens' Projection (Maybe ProjectionType)+pProjectionType = lens _pProjectionType (\s a -> s { _pProjectionType = a })++instance FromJSON Projection where+ parseJSON = withObject "Projection" $ \o -> Projection+ <$> o .: "NonKeyAttributes"+ <*> o .:? "ProjectionType"++instance ToJSON Projection where+ toJSON Projection{..} = object+ [ "ProjectionType" .= _pProjectionType+ , "NonKeyAttributes" .= _pNonKeyAttributes+ ]++data Select+ = AllAttributes -- ^ ALL_ATTRIBUTES+ | AllProjectedAttributes -- ^ ALL_PROJECTED_ATTRIBUTES+ | Count -- ^ COUNT+ | SpecificAttributes -- ^ SPECIFIC_ATTRIBUTES+ deriving (Eq, Ord, Show, Generic, Enum)++instance Hashable Select++instance FromText Select where+ parser = takeText >>= \case+ "ALL_ATTRIBUTES" -> pure AllAttributes+ "ALL_PROJECTED_ATTRIBUTES" -> pure AllProjectedAttributes+ "COUNT" -> pure Count+ "SPECIFIC_ATTRIBUTES" -> pure SpecificAttributes+ e -> fail $+ "Failure parsing Select from " ++ show e++instance ToText Select where+ toText = \case+ AllAttributes -> "ALL_ATTRIBUTES"+ AllProjectedAttributes -> "ALL_PROJECTED_ATTRIBUTES"+ Count -> "COUNT"+ SpecificAttributes -> "SPECIFIC_ATTRIBUTES"++instance ToByteString Select+instance ToHeader Select+instance ToQuery Select++instance FromJSON Select where+ parseJSON = parseJSONText "Select"++instance ToJSON Select where+ toJSON = toJSONText++data KeySchemaElement = KeySchemaElement+ { _kseAttributeName :: Text+ , _kseKeyType :: KeyType+ } deriving (Eq, Show)++-- | 'KeySchemaElement' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'kseAttributeName' @::@ 'Text'+--+-- * 'kseKeyType' @::@ 'KeyType'+--+keySchemaElement :: Text -- ^ 'kseAttributeName'+ -> KeyType -- ^ 'kseKeyType'+ -> KeySchemaElement+keySchemaElement p1 p2 = KeySchemaElement+ { _kseAttributeName = p1+ , _kseKeyType = p2+ }++-- | The name of a key attribute.+kseAttributeName :: Lens' KeySchemaElement Text+kseAttributeName = lens _kseAttributeName (\s a -> s { _kseAttributeName = a })++-- | The attribute data, consisting of the data type and the attribute value+-- itself.+kseKeyType :: Lens' KeySchemaElement KeyType+kseKeyType = lens _kseKeyType (\s a -> s { _kseKeyType = a })++instance FromJSON KeySchemaElement where+ parseJSON = withObject "KeySchemaElement" $ \o -> KeySchemaElement+ <$> o .: "AttributeName"+ <*> o .: "KeyType"++instance ToJSON KeySchemaElement where+ toJSON KeySchemaElement{..} = object+ [ "AttributeName" .= _kseAttributeName+ , "KeyType" .= _kseKeyType+ ]++newtype DeleteRequest = DeleteRequest+ { _dKey :: Map Text AttributeValue+ } deriving (Eq, Show, Monoid, Semigroup)++-- | 'DeleteRequest' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'dKey' @::@ 'HashMap' 'Text' 'AttributeValue'+--+deleteRequest :: DeleteRequest+deleteRequest = DeleteRequest+ { _dKey = mempty+ }++-- | A map of attribute name to attribute values, representing the primary key of+-- the item to delete. All of the table's primary key attributes must be+-- specified, and their data types must match those of the table's key schema.+dKey :: Lens' DeleteRequest (HashMap Text AttributeValue)+dKey = lens _dKey (\s a -> s { _dKey = a }) . _Map++instance FromJSON DeleteRequest where+ parseJSON = withObject "DeleteRequest" $ \o -> DeleteRequest+ <$> o .: "Key"++instance ToJSON DeleteRequest where+ toJSON DeleteRequest{..} = object+ [ "Key" .= _dKey+ ]++data UpdateGlobalSecondaryIndexAction = UpdateGlobalSecondaryIndexAction+ { _ugsiaIndexName :: Text+ , _ugsiaProvisionedThroughput :: ProvisionedThroughput+ } deriving (Eq, Show)++-- | 'UpdateGlobalSecondaryIndexAction' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'ugsiaIndexName' @::@ 'Text'+--+-- * 'ugsiaProvisionedThroughput' @::@ 'ProvisionedThroughput'+--+updateGlobalSecondaryIndexAction :: Text -- ^ 'ugsiaIndexName'+ -> ProvisionedThroughput -- ^ 'ugsiaProvisionedThroughput'+ -> UpdateGlobalSecondaryIndexAction+updateGlobalSecondaryIndexAction p1 p2 = UpdateGlobalSecondaryIndexAction+ { _ugsiaIndexName = p1+ , _ugsiaProvisionedThroughput = p2+ }++-- | The name of the global secondary index to be updated.+ugsiaIndexName :: Lens' UpdateGlobalSecondaryIndexAction Text+ugsiaIndexName = lens _ugsiaIndexName (\s a -> s { _ugsiaIndexName = a })++ugsiaProvisionedThroughput :: Lens' UpdateGlobalSecondaryIndexAction ProvisionedThroughput+ugsiaProvisionedThroughput =+ lens _ugsiaProvisionedThroughput+ (\s a -> s { _ugsiaProvisionedThroughput = a })++instance FromJSON UpdateGlobalSecondaryIndexAction where+ parseJSON = withObject "UpdateGlobalSecondaryIndexAction" $ \o -> UpdateGlobalSecondaryIndexAction+ <$> o .: "IndexName"+ <*> o .: "ProvisionedThroughput"++instance ToJSON UpdateGlobalSecondaryIndexAction where+ toJSON UpdateGlobalSecondaryIndexAction{..} = object+ [ "IndexName" .= _ugsiaIndexName+ , "ProvisionedThroughput" .= _ugsiaProvisionedThroughput+ ]++newtype PutRequest = PutRequest+ { _pItem :: Map Text AttributeValue+ } deriving (Eq, Show, Monoid, Semigroup)++-- | 'PutRequest' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'pItem' @::@ 'HashMap' 'Text' 'AttributeValue'+--+putRequest :: PutRequest+putRequest = PutRequest+ { _pItem = mempty+ }++-- | A map of attribute name to attribute values, representing the primary key of+-- an item to be processed by /PutItem/. All of the table's primary key attributes+-- must be specified, and their data types must match those of the table's key+-- schema. If any attributes are present in the item which are part of an index+-- key schema for the table, their types must match the index key schema.+pItem :: Lens' PutRequest (HashMap Text AttributeValue)+pItem = lens _pItem (\s a -> s { _pItem = a }) . _Map++instance FromJSON PutRequest where+ parseJSON = withObject "PutRequest" $ \o -> PutRequest+ <$> o .: "Item"++instance ToJSON PutRequest where+ toJSON PutRequest{..} = object+ [ "Item" .= _pItem+ ]++data Condition = Condition+ { _cAttributeValueList :: List "AttributeValueList" AttributeValue+ , _cComparisonOperator :: ComparisonOperator+ } deriving (Eq, Show)++-- | 'Condition' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'cAttributeValueList' @::@ ['AttributeValue']+--+-- * 'cComparisonOperator' @::@ 'ComparisonOperator'+--+condition :: ComparisonOperator -- ^ 'cComparisonOperator'+ -> Condition+condition p1 = Condition+ { _cComparisonOperator = p1+ , _cAttributeValueList = mempty+ }++-- | One or more values to evaluate against the supplied attribute. The number of+-- values in the list depends on the /ComparisonOperator/ being used.+--+-- 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+-- 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+-- compares binary values, for example when evaluating query expressions.+cAttributeValueList :: Lens' Condition [AttributeValue]+cAttributeValueList =+ lens _cAttributeValueList (\s a -> s { _cAttributeValueList = a })+ . _List++-- | A comparator for evaluating attributes. For example, equals, greater than,+-- less than, etc.+--+-- The following comparison operators are available:+--+-- 'EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS |BEGINS_WITH | IN | BETWEEN'+--+-- The following are descriptions of each comparison operator.+--+-- 'EQ' : Equal. 'EQ' is supported for all datatypes, including lists and maps.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, Binary, String Set, Number Set, or Binary Set. If an item+-- contains an /AttributeValue/ element of a different type than the one specified+-- in the request, the value does not match. For example, '{"S":"6"}' does not+-- equal '{"N":"6"}'. Also, '{"N":"6"}' does not equal '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'NE' : Not equal. 'NE' is supported for all datatypes, including lists and+-- maps.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ of type String,+-- Number, Binary, String Set, Number Set, or Binary Set. If an item contains an /AttributeValue/ of a different type than the one specified in the request, the+-- value does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not equal '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'LE' : Less than or equal.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'LT' : Less than.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ of type String,+-- Number, or Binary (not a set type). If an item contains an /AttributeValue/+-- element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'GE' : Greater than or equal.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'GT' : Greater than.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'NOT_NULL' : The attribute exists. 'NOT_NULL' is supported for all datatypes,+-- including lists and maps.+--+-- 'NULL' : The attribute does not exist. 'NULL' is supported for all datatypes,+-- including lists and maps.+--+-- 'CONTAINS' : Checks for a subsequence, or value in a set.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If the target attribute of the+-- comparison is of type String, then the operator checks for a substring match.+-- If the target attribute of the comparison is of type Binary, then the+-- operator looks for a subsequence of the target that matches the input. If the+-- target attribute of the comparison is a set ("'SS'", "'NS'", or "'BS'"), then the+-- operator evaluates to true if it finds an exact match with any member of the+-- set.+--+-- CONTAINS is supported for lists: When evaluating "'a CONTAINS b'", "'a'" can be+-- a list; however, "'b'" cannot be a set, a map, or a list.+--+-- 'NOT_CONTAINS' : Checks for absence of a subsequence, or absence of a value+-- in a set.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If the target attribute of the+-- comparison is a String, then the operator checks for the absence of a+-- substring match. If the target attribute of the comparison is Binary, then+-- the operator checks for the absence of a subsequence of the target that+-- matches the input. If the target attribute of the comparison is a set ("'SS'", "'NS'", or "'BS'"), then the operator evaluates to true if it /does not/ find an+-- exact match with any member of the set.+--+-- NOT_CONTAINS is supported for lists: When evaluating "'a NOT CONTAINS b'", "'a'"+-- can be a list; however, "'b'" cannot be a set, a map, or a list.+--+-- 'BEGINS_WITH' : Checks for a prefix.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ of type String or+-- Binary (not a Number or a set type). The target attribute of the comparison+-- must be of type String or Binary (not a Number or a set type).+--+--+--+-- 'IN' : Checks for matching elements within two sets.+--+-- /AttributeValueList/ can contain one or more /AttributeValue/ elements of type+-- String, Number, or Binary (not a set type). These attributes are compared+-- against an existing set type attribute of an item. If any elements of the+-- input set are present in the item attribute, the expression evaluates to true.+--+-- 'BETWEEN' : Greater than or equal to the first value, and less than or equal+-- to the second value.+--+-- /AttributeValueList/ must contain two /AttributeValue/ elements of the same+-- type, either String, Number, or Binary (not a set type). A target attribute+-- matches if the target value is greater than, or equal to, the first element+-- and less than, or equal to, the second element. If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not compare to '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'+--+-- For usage examples of /AttributeValueList/ and /ComparisonOperator/, see <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.html Legacy Conditional Parameters> in the /Amazon DynamoDB Developer Guide/.+cComparisonOperator :: Lens' Condition ComparisonOperator+cComparisonOperator =+ lens _cComparisonOperator (\s a -> s { _cComparisonOperator = a })++instance FromJSON Condition where+ parseJSON = withObject "Condition" $ \o -> Condition+ <$> o .: "AttributeValueList"+ <*> o .: "ComparisonOperator"++instance ToJSON Condition where+ toJSON Condition{..} = object+ [ "AttributeValueList" .= _cAttributeValueList+ , "ComparisonOperator" .= _cComparisonOperator+ ]++data ConditionalOperator+ = And -- ^ AND+ | Or -- ^ OR+ deriving (Eq, Ord, Show, Generic, Enum)++instance Hashable ConditionalOperator++instance FromText ConditionalOperator where+ parser = takeText >>= \case+ "AND" -> pure And+ "OR" -> pure Or+ e -> fail $+ "Failure parsing ConditionalOperator from " ++ show e instance ToText ConditionalOperator where toText = \case
gen/Network/AWS/DynamoDB/UpdateItem.hs view
@@ -21,13 +21,14 @@ -- Portability : non-portable (GHC extensions) -- | Edits an existing item's attributes, or adds a new item to the table if it--- does not already exist. You can put, delete, or add attribute values. You--- can also perform a conditional update (insert a new attribute name-value--- pair if it doesn't exist, or replace an existing name-value pair if it has--- certain expected attribute values). You can also return the item's--- attribute values in the same UpdateItem operation using the ReturnValues--- parameter.+-- does not already exist. You can put, delete, or add attribute values. You can+-- also perform a conditional update (insert a new attribute name-value pair if+-- it doesn't exist, or replace an existing name-value pair if it has certain+-- expected attribute values). --+-- You can also return the item's attribute values in the same /UpdateItem/+-- operation using the /ReturnValues/ parameter.+-- -- <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateItem.html> module Network.AWS.DynamoDB.UpdateItem (@@ -124,232 +125,345 @@ , _uiExpressionAttributeValues = mempty } --- | There is a newer parameter available. Use UpdateExpression instead. Note--- that if you use AttributeUpdates and UpdateExpression at the same time,--- DynamoDB will return a ValidationException exception. This parameter can--- be used for modifying top-level attributes; however, it does not support--- individual list or map elements. The names of attributes to be modified,--- the action to perform on each, and the new value for each. If you are--- updating an attribute that is an index key attribute for any indexes on--- that table, the attribute type must match the index key type defined in--- the AttributesDefinition of the table description. You can use UpdateItem--- to update any nonkey attributes. Attribute values cannot be null. String--- and Binary type attributes must have lengths greater than zero. Set type--- attributes must not be empty. Requests with empty values will be rejected--- with a ValidationException exception. Each AttributeUpdates element--- consists of an attribute name to modify, along with the following: Value--- - The new value, if applicable, for this attribute. Action - A value that--- specifies how to perform the update. This action is only valid for an--- existing attribute whose data type is Number or is a set; do not use ADD--- for other data types. If an item with the specified primary key is found--- in the table, the following values perform the following actions: PUT ---- Adds the specified attribute to the item. If the attribute already--- exists, it is replaced by the new value. DELETE - Removes the attribute--- and its value, if no value is specified for DELETE. The data type of the--- specified value must match the existing value's data type. If a set of--- values is specified, then those values are subtracted from the old set.--- For example, if the attribute value was the set [a,b,c] and the DELETE--- action specifies [a,c], then the final attribute value is [b]. Specifying--- an empty set is an error. ADD - Adds the specified value to the item, if--- the attribute does not already exist. If the attribute does exist, then--- the behavior of ADD depends on the data type of the attribute: 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 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 is [1,2,3]. An error occurs if an ADD action is specified for a set--- attribute and the attribute type specified does not match the existing--- set type. Both sets must have the same primitive data type. For example,--- if the existing data type is a set of strings, Value must also be a set--- of strings. If no item with the specified key is found in the table, the--- following values perform the following actions: 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. ADD - Causes DynamoDB to creat 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. If you specify any attributes--- that are part of an index key, then the data types for those attributes--- must match those of the schema in the table's attribute definition.+-- | There is a newer parameter available. Use /UpdateExpression/ instead. Note+-- that if you use /AttributeUpdates/ and /UpdateExpression/ at the same time,+-- DynamoDB will return a /ValidationException/ exception.+--+-- This parameter can be used for modifying top-level attributes; however, it+-- does not support individual list or map elements.+--+-- The names of attributes to be modified, the action to perform on each, and+-- the new value for each. If you are updating an attribute that is an index key+-- attribute for any indexes on that table, the attribute type must match the+-- index key type defined in the /AttributesDefinition/ of the table description.+-- You can use /UpdateItem/ to update any nonkey attributes.+--+-- Attribute values cannot be null. String and Binary type attributes must have+-- lengths greater than zero. Set type attributes must not be empty. Requests+-- with empty values will be rejected with a /ValidationException/ exception.+--+-- Each /AttributeUpdates/ element consists of an attribute name to modify, along+-- with the following:+--+-- /Value/ - The new value, if applicable, for this attribute.+--+-- /Action/ - A value that specifies how to perform the update. This action is+-- only valid for an existing attribute whose data type is Number or is a set;+-- do not use 'ADD' for other data types.+--+-- If an item with the specified primary key is found in the table, the+-- following values perform the following actions:+--+-- 'PUT' - Adds the specified attribute to the item. If the attribute already+-- exists, it is replaced by the new value.+--+-- 'DELETE' - Removes the attribute and its value, if no value is specified for 'DELETE'. The data type of the specified value must match the existing value's+-- data type.+--+-- If a set of values is specified, then those values are subtracted from the+-- old set. For example, if the attribute value was the set '[a,b,c]' and the 'DELETE' action specifies '[a,c]', then the final attribute value is '[b]'. Specifying an+-- empty set is an error.+--+-- 'ADD' - Adds the specified value to the item, if the attribute does not+-- already exist. If the attribute does exist, then the behavior of 'ADD' depends+-- on the data type of the attribute:+--+-- 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 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+-- is '[1,2,3]'. An error occurs if an 'ADD' action is specified for a set attribute+-- and the attribute type specified does not match the existing set type.+--+-- Both sets must have the same primitive data type. For example, if the+-- existing data type is a set of strings, /Value/ must also be a set of strings.+--+-- If no item with the specified key is found in the table, the following+-- values perform the following actions:+--+-- '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.+--+-- 'ADD' - Causes DynamoDB to creat 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.+--+-- If you specify any attributes that are part of an index key, then the+-- data types for those attributes must match those of the schema in the table's+-- attribute definition. uiAttributeUpdates :: Lens' UpdateItem (HashMap Text AttributeValueUpdate) uiAttributeUpdates = lens _uiAttributeUpdates (\s a -> s { _uiAttributeUpdates = a }) . _Map -- | A condition that must be satisfied in order for a conditional update to--- succeed. An expression can contain any of the following: Boolean--- functions: ATTRIBUTE_EXIST | CONTAINS | BEGINS_WITH Comparison operators:--- = | <> | < | > | <= | >= | BETWEEN | IN--- Logical operators: NOT | AND | OR.+-- succeed.+--+-- An expression can contain any of the following:+--+-- Boolean functions: 'ATTRIBUTE_EXIST | CONTAINS | BEGINS_WITH'+--+-- Comparison operators: ' = | <> | < | > | <= | >= | BETWEEN | IN'+--+-- Logical operators: 'NOT | AND | OR'+--+-- uiConditionExpression :: Lens' UpdateItem (Maybe Text) uiConditionExpression = lens _uiConditionExpression (\s a -> s { _uiConditionExpression = a }) --- | 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. A logical operator to apply to--- the conditions in the Expected map: AND - If all of the conditions--- evaluate to true, then the entire map evaluates to true. OR - If at least--- one of the conditions evaluate to true, then the entire map evaluates to--- true. If you omit ConditionalOperator, then AND is the default. The--- operation will succeed only if the entire map evaluates to true.+-- | 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.+--+-- A logical operator to apply to the conditions in the /Expected/ map:+--+-- 'AND' - If all of the conditions evaluate to true, then the entire map+-- evaluates to true.+--+-- 'OR' - If at least one of the conditions evaluate to true, then the entire map+-- evaluates to true.+--+-- If you omit /ConditionalOperator/, then 'AND' is the default.+--+-- The operation will succeed only if the entire map evaluates to true. uiConditionalOperator :: Lens' UpdateItem (Maybe ConditionalOperator) uiConditionalOperator = lens _uiConditionalOperator (\s a -> s { _uiConditionalOperator = a }) --- | There is a newer parameter available. Use ConditionExpression instead.--- Note that if you use Expected and ConditionExpression at the same time,--- DynamoDB will return a ValidationException exception. This parameter does--- not support lists or maps. A map of attribute/condition pairs. Expected--- provides a conditional block for the UpdateItem operation. Each element--- of Expected consists of an attribute name, a comparison operator, and one--- or more values. DynamoDB compares the attribute with the value(s) you--- supplied, using the comparison operator. For each Expected element, the--- result of the evaluation is either true or false. If you specify more--- than one element in the Expected 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.) If the Expected map--- evaluates to true, then the conditional operation succeeds; otherwise, it--- fails. Expected contains the following: AttributeValueList - One or more--- values to evaluate against the supplied attribute. The number of values--- in the list depends on the ComparisonOperator being used. 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 greater than B. For a--- list of code values, see--- http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters. For type--- Binary, DynamoDB treats each byte of the binary data as unsigned when it--- compares binary values, for example when evaluating query expressions.--- ComparisonOperator - A comparator for evaluating attributes in the--- AttributeValueList. When performing the comparison, DynamoDB uses--- strongly consistent reads. The following comparison operators are--- available: EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS |--- NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN The following are descriptions--- of each comparison operator. EQ : Equal. EQ is supported for all--- datatypes, including lists and maps. AttributeValueList can contain only--- one AttributeValue element of type String, Number, Binary, String Set,--- Number Set, or Binary Set. If an item contains an AttributeValue element--- of a different type than the one specified in the request, the value does--- not match. For example, {"S":"6"} does not equal {"N":"6"}. Also,--- {"N":"6"} does not equal {"NS":["6", "2", "1"]}. NE : Not equal. NE is--- supported for all datatypes, including lists and maps. AttributeValueList--- can contain only one AttributeValue of type String, Number, Binary,--- String Set, Number Set, or Binary Set. If an item contains an--- AttributeValue of a different type than the one specified in the request,--- the value does not match. For example, {"S":"6"} does not equal--- {"N":"6"}. Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}. LE :--- Less than or equal. AttributeValueList can contain only one--- AttributeValue element of type String, Number, or Binary (not a set--- type). If an item contains an AttributeValue element of a different type--- than the one specified in the request, the value does not match. For--- example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not--- compare to {"NS":["6", "2", "1"]}. LT : Less than. AttributeValueList can--- contain only one AttributeValue of type String, Number, or Binary (not a--- set type). If an item contains an AttributeValue element of a different--- type than the one specified in the request, the value does not match. For--- example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not--- compare to {"NS":["6", "2", "1"]}. GE : Greater than or equal.--- AttributeValueList can contain only one AttributeValue element of type--- String, Number, or Binary (not a set type). If an item contains an--- AttributeValue element of a different type than the one specified in the--- request, the value does not match. For example, {"S":"6"} does not equal--- {"N":"6"}. Also, {"N":"6"} does not compare to {"NS":["6", "2", "1"]}. GT--- : Greater than. AttributeValueList can contain only one AttributeValue--- element of type String, Number, or Binary (not a set type). If an item--- contains an AttributeValue element of a different type than the one--- specified in the request, the value does not match. For example,--- {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not compare to--- {"NS":["6", "2", "1"]}. NOT_NULL : The attribute exists. NOT_NULL is--- supported for all datatypes, including lists and maps. NULL : The--- attribute does not exist. NULL is supported for all datatypes, including--- lists and maps. CONTAINS : Checks for a subsequence, or value in a set.--- AttributeValueList can contain only one AttributeValue element of type--- String, Number, or Binary (not a set type). If the target attribute of--- the comparison is of type String, then the operator checks for a--- substring match. If the target attribute of the comparison is of type--- Binary, then the operator looks for a subsequence of the target that--- matches the input. If the target attribute of the comparison is a set--- ("SS", "NS", or "BS"), then the operator evaluates to true if it finds an--- exact match with any member of the set. CONTAINS is supported for lists:--- When evaluating "a CONTAINS b", "a" can be a list; however, "b" cannot be--- a set, a map, or a list. NOT_CONTAINS : Checks for absence of a--- subsequence, or absence of a value in a set. AttributeValueList can--- contain only one AttributeValue element of type String, Number, or Binary--- (not a set type). If the target attribute of the comparison is a String,--- then the operator checks for the absence of a substring match. If the--- target attribute of the comparison is Binary, then the operator checks--- for the absence of a subsequence of the target that matches the input. If--- the target attribute of the comparison is a set ("SS", "NS", or "BS"),--- then the operator evaluates to true if it does not find an exact match--- with any member of the set. NOT_CONTAINS is supported for lists: When--- evaluating "a NOT CONTAINS b", "a" can be a list; however, "b" cannot be--- a set, a map, or a list. BEGINS_WITH : Checks for a prefix.--- AttributeValueList can contain only one AttributeValue of type String or--- Binary (not a Number or a set type). The target attribute of the--- comparison must be of type String or Binary (not a Number or a set type).--- IN : Checks for matching elements within two sets. AttributeValueList can--- contain one or more AttributeValue elements of type String, Number, or--- Binary (not a set type). These attributes are compared against an--- existing set type attribute of an item. If any elements of the input set--- are present in the item attribute, the expression evaluates to true.--- BETWEEN : Greater than or equal to the first value, and less than or--- equal to the second value. AttributeValueList must contain two--- AttributeValue elements of the same type, either String, Number, or--- Binary (not a set type). A target attribute matches if the target value--- is greater than, or equal to, the first element and less than, or equal--- to, the second element. If an item contains an AttributeValue element of--- a different type than the one specified in the request, the value does--- not match. For example, {"S":"6"} does not compare to {"N":"6"}. Also,--- {"N":"6"} does not compare to {"NS":["6", "2", "1"]} For usage examples--- of AttributeValueList and ComparisonOperator, see Legacy Conditional--- Parameters in the Amazon DynamoDB Developer Guide. For backward--- compatibility with previous DynamoDB releases, the following parameters--- can be used instead of AttributeValueList and ComparisonOperator: Value ---- A value for DynamoDB to compare with an attribute. Exists - A Boolean--- value that causes DynamoDB to evaluate the value before attempting the--- conditional operation: If Exists is true, DynamoDB will check to see if--- that attribute value already exists in the table. If it is found, then--- the condition evaluates to true; otherwise the condition evaluate to--- false. If Exists is false, DynamoDB assumes that the attribute value does--- not exist in the table. If in fact the value does not exist, then the--- assumption 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. 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.+-- | There is a newer parameter available. Use / ConditionExpression / instead.+-- Note that if you use /Expected/ and / ConditionExpression / at the same time,+-- DynamoDB will return a /ValidationException/ exception.+--+-- This parameter does not support lists or maps.+--+-- A map of attribute/condition pairs. /Expected/ provides a conditional block+-- for the /UpdateItem/ operation.+--+-- Each element of /Expected/ consists of an attribute name, a comparison+-- operator, and one or more values. DynamoDB compares the attribute with the+-- value(s) you supplied, using the comparison operator. For each /Expected/+-- element, the result of the evaluation is either true or false.+--+-- If you specify more than one element in the /Expected/ 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.)+--+-- If the /Expected/ map evaluates to true, then the conditional operation+-- succeeds; otherwise, it fails.+--+-- /Expected/ contains the following:+--+-- /AttributeValueList/ - One or more values to evaluate against the supplied+-- attribute. The number of values in the list depends on the /ComparisonOperator/+-- being used.+--+-- 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+-- 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+-- when it compares binary values, for example when evaluating query expressions.+--+-- /ComparisonOperator/ - A comparator for evaluating attributes in the /AttributeValueList/. When performing the comparison, DynamoDB uses strongly consistent reads.+--+-- The following comparison operators are available:+--+-- 'EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS |BEGINS_WITH | IN | BETWEEN'+--+-- The following are descriptions of each comparison operator.+--+-- 'EQ' : Equal. 'EQ' is supported for all datatypes, including lists and maps.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, Binary, String Set, Number Set, or Binary Set. If an item+-- contains an /AttributeValue/ element of a different type than the one specified+-- in the request, the value does not match. For example, '{"S":"6"}' does not+-- equal '{"N":"6"}'. Also, '{"N":"6"}' does not equal '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'NE' : Not equal. 'NE' is supported for all datatypes, including lists and+-- maps.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ of type String,+-- Number, Binary, String Set, Number Set, or Binary Set. If an item contains an /AttributeValue/ of a different type than the one specified in the request, the+-- value does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not equal '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'LE' : Less than or equal.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'LT' : Less than.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ of type String,+-- Number, or Binary (not a set type). If an item contains an /AttributeValue/+-- element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'GE' : Greater than or equal.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'GT' : Greater than.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not equal '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'.+--+--+--+-- 'NOT_NULL' : The attribute exists. 'NOT_NULL' is supported for all datatypes,+-- including lists and maps.+--+-- 'NULL' : The attribute does not exist. 'NULL' is supported for all datatypes,+-- including lists and maps.+--+-- 'CONTAINS' : Checks for a subsequence, or value in a set.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If the target attribute of the+-- comparison is of type String, then the operator checks for a substring match.+-- If the target attribute of the comparison is of type Binary, then the+-- operator looks for a subsequence of the target that matches the input. If the+-- target attribute of the comparison is a set ("'SS'", "'NS'", or "'BS'"), then the+-- operator evaluates to true if it finds an exact match with any member of the+-- set.+--+-- CONTAINS is supported for lists: When evaluating "'a CONTAINS b'", "'a'" can be+-- a list; however, "'b'" cannot be a set, a map, or a list.+--+-- 'NOT_CONTAINS' : Checks for absence of a subsequence, or absence of a value+-- in a set.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ element of type+-- String, Number, or Binary (not a set type). If the target attribute of the+-- comparison is a String, then the operator checks for the absence of a+-- substring match. If the target attribute of the comparison is Binary, then+-- the operator checks for the absence of a subsequence of the target that+-- matches the input. If the target attribute of the comparison is a set ("'SS'", "'NS'", or "'BS'"), then the operator evaluates to true if it /does not/ find an+-- exact match with any member of the set.+--+-- NOT_CONTAINS is supported for lists: When evaluating "'a NOT CONTAINS b'", "'a'"+-- can be a list; however, "'b'" cannot be a set, a map, or a list.+--+-- 'BEGINS_WITH' : Checks for a prefix.+--+-- /AttributeValueList/ can contain only one /AttributeValue/ of type String or+-- Binary (not a Number or a set type). The target attribute of the comparison+-- must be of type String or Binary (not a Number or a set type).+--+--+--+-- 'IN' : Checks for matching elements within two sets.+--+-- /AttributeValueList/ can contain one or more /AttributeValue/ elements of type+-- String, Number, or Binary (not a set type). These attributes are compared+-- against an existing set type attribute of an item. If any elements of the+-- input set are present in the item attribute, the expression evaluates to true.+--+-- 'BETWEEN' : Greater than or equal to the first value, and less than or equal+-- to the second value.+--+-- /AttributeValueList/ must contain two /AttributeValue/ elements of the same+-- type, either String, Number, or Binary (not a set type). A target attribute+-- matches if the target value is greater than, or equal to, the first element+-- and less than, or equal to, the second element. If an item contains an /AttributeValue/ element of a different type than the one specified in the request, the value+-- does not match. For example, '{"S":"6"}' does not compare to '{"N":"6"}'. Also, '{"N":"6"}' does not compare to '{"NS":["6", "2", "1"]}'+--+-- For usage examples of /AttributeValueList/ and /ComparisonOperator/, see <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.html Legacy Conditional Parameters> in the /Amazon DynamoDB Developer Guide/.+--+-- For backward compatibility with previous DynamoDB releases, the following+-- parameters can be used instead of /AttributeValueList/ and /ComparisonOperator/:+--+-- /Value/ - A value for DynamoDB to compare with an attribute.+--+-- /Exists/ - A Boolean value that causes DynamoDB to evaluate the value before+-- attempting the conditional operation:+--+-- If /Exists/ is 'true', DynamoDB will check to see if that attribute value+-- already exists in the table. If it is found, then the condition evaluates to+-- true; otherwise the condition evaluate to false.+--+-- If /Exists/ is 'false', DynamoDB assumes that the attribute value does /not/+-- exist in the table. If in fact the value does not exist, then the assumption+-- 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.+--+-- 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. uiExpected :: Lens' UpdateItem (HashMap Text ExpectedAttributeValue) 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: To--- shorten an attribute name that is very long or unwieldy in an expression.+-- following are some use cases for an /ExpressionAttributeNames/ value:+--+-- To shorten an attribute name that is very long or unwieldy in an+-- expression.+-- -- To create a placeholder for repeating occurrences of an attribute name in--- an expression. To prevent special characters in an attribute name from--- being misinterpreted in an expression. Use the # character in an--- expression to dereference an attribute name. For example, consider the--- following expression: order.customerInfo.LastName = "Smith" OR--- order.customerInfo.LastName = "Jones" Now suppose that you specified the--- following for ExpressionAttributeNames:--- {"n":"order.customerInfo.LastName"} The expression can now be simplified--- as follows: #n = "Smith" OR #n = "Jones".+-- an expression.+--+-- To prevent special characters in an attribute name from being+-- misinterpreted in an expression.+--+-- Use the # character in an expression to dereference an attribute name. For+-- example, consider the following expression:+--+-- 'order.customerInfo.LastName = "Smith" OR order.customerInfo.LastName ="Jones"'+--+-- Now suppose that you specified the following for /ExpressionAttributeNames/:+--+-- '{"n":"order.customerInfo.LastName"}'+--+-- The expression can now be simplified as follows:+--+-- '#n = "Smith" OR #n = "Jones"'+-- uiExpressionAttributeNames :: Lens' UpdateItem (HashMap Text Text) uiExpressionAttributeNames = lens _uiExpressionAttributeNames (\s a -> s { _uiExpressionAttributeNames = a }) . _Map --- | 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: ProductStatus IN--- ("Available","Backordered","Discontinued") Now suppose that you specified--- the following for ExpressionAttributeValues: { "a":{"S":"Available"},--- "b":{"S":"Backordered"}, "d":{"S":"Discontinued"} } The expression can--- now be simplified as follows: ProductStatus IN (:a,:b,:c).+-- | 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:+--+-- 'ProductStatus IN ("Available","Backordered","Discontinued")'+--+-- Now suppose that you specified the following for /ExpressionAttributeValues/:+--+-- '{ "a":{"S":"Available"}, "b":{"S":"Backordered"}, "d":{"S":"Discontinued"} }'+--+-- The expression can now be simplified as follows:+--+-- 'ProductStatus IN (:a,:b,:c)'+-- uiExpressionAttributeValues :: Lens' UpdateItem (HashMap Text AttributeValue) uiExpressionAttributeValues = lens _uiExpressionAttributeValues@@ -357,11 +471,12 @@ . _Map -- | The primary key of the item to be updated. Each element consists of an--- attribute name and a value for that attribute. For the primary key, you--- must provide all of the attributes. For example, with a hash type primary--- key, you only need to specify the hash attribute. For a hash-and-range--- type primary key, you must specify both the hash attribute and the range--- attribute.+-- attribute name and a value for that attribute.+--+-- For the primary key, you must provide all of the attributes. For example,+-- with a hash type primary key, you only need to specify the hash attribute.+-- For a hash-and-range type primary key, you must specify both the hash+-- attribute and the range attribute. uiKey :: Lens' UpdateItem (HashMap Text AttributeValue) uiKey = lens _uiKey (\s a -> s { _uiKey = a }) . _Map @@ -370,24 +485,32 @@ lens _uiReturnConsumedCapacity (\s a -> s { _uiReturnConsumedCapacity = a }) --- | A value that if set to SIZE, the response includes statistics about item--- collections, if any, that were modified during the operation are returned--- in the response. If set to NONE (the default), no statistics are--- returned.+-- | A value that if set to 'SIZE', the response includes statistics about item+-- collections, if any, that were modified during the operation are returned in+-- the response. If set to 'NONE' (the default), no statistics are returned. uiReturnItemCollectionMetrics :: Lens' UpdateItem (Maybe ReturnItemCollectionMetrics) uiReturnItemCollectionMetrics = lens _uiReturnItemCollectionMetrics (\s a -> s { _uiReturnItemCollectionMetrics = a }) --- | Use ReturnValues if you want to get the item attributes as they appeared--- either before or after they were updated. For UpdateItem, the valid--- values are: NONE - If ReturnValues is not specified, or if its value is--- NONE, then nothing is returned. (This setting is the default for--- ReturnValues.) ALL_OLD - If UpdateItem overwrote an attribute name-value--- pair, then the content of the old item is returned. UPDATED_OLD - The old--- versions of only the updated attributes are returned. ALL_NEW - All of--- the attributes of the new version of the item are returned. UPDATED_NEW ---- The new versions of only the updated attributes are returned.+-- | Use /ReturnValues/ if you want to get the item attributes as they appeared+-- either before or after they were updated. For /UpdateItem/, the valid values+-- are:+--+-- 'NONE' - If /ReturnValues/ is not specified, or if its value is 'NONE', then+-- nothing is returned. (This setting is the default for /ReturnValues/.)+--+-- 'ALL_OLD' - If /UpdateItem/ overwrote an attribute name-value pair, then the+-- content of the old item is returned.+--+-- 'UPDATED_OLD' - The old versions of only the updated attributes are returned.+--+-- 'ALL_NEW' - All of the attributes of the new version of the item are+-- returned.+--+-- 'UPDATED_NEW' - The new versions of only the updated attributes are returned.+--+-- uiReturnValues :: Lens' UpdateItem (Maybe ReturnValue) uiReturnValues = lens _uiReturnValues (\s a -> s { _uiReturnValues = a }) @@ -395,47 +518,68 @@ uiTableName :: Lens' UpdateItem Text uiTableName = lens _uiTableName (\s a -> s { _uiTableName = a }) --- | An expression that defines one or more attributes to be updated, the--- action to be performed on them, and new value(s) for them. The following--- action values are available for UpdateExpression. SET - Adds one or more--- attributes and values to an item. If any of these attribute already--- exist, they are replaced by the new values. You can also use SET to add--- or subtract from an attribute that is of type Number. SET supports the--- following functions: if_not_exists (path, operand) - if the item does not--- contain an attribute at the specified path, then if_not_exists evaluates--- to operand; otherwise, it evaluates to path. You can use this function to--- avoid overwriting an attribute that may already be present in the item.--- list_append (operand, operand) - evaluates to a list with a new element--- added to it. You can append the new element to the start or the end of--- the list by reversing the order of the operands. These function names are--- case-sensitive. REMOVE - Removes one or more attributes from an item. ADD--- - Adds the specified value to the item, if the attribute does not already--- exist. If the attribute does exist, then the behavior of ADD depends on--- the data type of the attribute: 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 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 does not match the existing set type. Both sets must have the--- same primitive data type. For example, if the existing data type is a set--- of strings, the Value must also be a set of strings. The ADD action only--- supports Number and set data types. In addition, ADD can only be used on--- top-level attributes, not nested attributes. DELETE - Deletes an element--- from a set. If a set of values is specified, then those values are--- subtracted from the old set. For example, if the attribute value was the--- set [a,b,c] and the DELETE action specifies [a,c], then the final--- attribute value is [b]. Specifying an empty set is an error. The DELETE--- action only supports Number and set data types. In addition, DELETE can--- only be used on top-level attributes, not nested attributes. 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.+-- | An expression that defines one or more attributes to be updated, the action+-- to be performed on them, and new value(s) for them.+--+-- The following action values are available for /UpdateExpression/.+--+-- 'SET' - Adds one or more attributes and values to an item. If any of these+-- attribute already exist, they are replaced by the new values. You can also+-- use 'SET' to add or subtract from an attribute that is of type Number.+--+-- 'SET' supports the following functions:+--+-- 'if_not_exists (path, operand)' - if the item does not contain an attribute+-- at the specified path, then 'if_not_exists' evaluates to operand; otherwise, it+-- evaluates to path. You can use this function to avoid overwriting an+-- attribute that may already be present in the item.+--+-- 'list_append (operand, operand)' - evaluates to a list with a new element+-- added to it. You can append the new element to the start or the end of the+-- list by reversing the order of the operands.+--+-- These function names are case-sensitive.+--+-- 'REMOVE' - Removes one or more attributes from an item.+--+-- 'ADD' - Adds the specified value to the item, if the attribute does not+-- already exist. If the attribute does exist, then the behavior of 'ADD' depends+-- on the data type of the attribute:+--+-- 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 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+-- does not match the existing set type.+--+-- Both sets must have the same primitive data type. For example, if the+-- existing data type is a set of strings, the /Value/ must also be a set of+-- strings.+--+-- The 'ADD' action only supports Number and set data types. In addition, 'ADD'+-- can only be used on top-level attributes, not nested attributes.+--+-- 'DELETE' - Deletes an element from a set.+--+-- If a set of values is specified, then those values are subtracted from the+-- old set. For example, if the attribute value was the set '[a,b,c]' and the 'DELETE' action specifies '[a,c]', then the final attribute value is '[b]'. Specifying an+-- empty set is an error.+--+-- The 'DELETE' action only supports Number and set data types. In addition, 'DELETE' can only be used on top-level attributes, not nested attributes.+--+-- 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'+--+-- uiUpdateExpression :: Lens' UpdateItem (Maybe Text) uiUpdateExpression = lens _uiUpdateExpression (\s a -> s { _uiUpdateExpression = a })@@ -463,10 +607,8 @@ , _uirItemCollectionMetrics = Nothing } --- | A map of attribute values as they appeared before the UpdateItem--- operation. This map only appears if ReturnValues was specified as--- something other than NONE in the request. Each element represents one--- attribute.+-- | A map of attribute values as they appeared before the /UpdateItem/ operation.+-- This map only appears if /ReturnValues/ was specified as something other than 'NONE' in the request. Each element represents one attribute. uirAttributes :: Lens' UpdateItemResponse (HashMap Text AttributeValue) uirAttributes = lens _uirAttributes (\s a -> s { _uirAttributes = a }) . _Map
gen/Network/AWS/DynamoDB/UpdateTable.hs view
@@ -22,18 +22,20 @@ -- | 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. The provisioned throughput--- values can be upgraded or downgraded based on the maximums and minimums--- listed in the Limits section in the Amazon DynamoDB 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. You cannot--- add, modify or delete indexes using UpdateTable. Indexes can only be--- defined at table creation time.+-- provisioned throughput feature of DynamoDB. --+-- 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/.+--+-- 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.+--+-- You cannot add, modify or delete indexes using /UpdateTable/. Indexes can only+-- be defined at table creation time.+-- -- <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateTable.html> module Network.AWS.DynamoDB.UpdateTable (@@ -83,8 +85,8 @@ , _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 one or more global secondary indexes on the table, together with+-- provisioned throughput settings for each index. utGlobalSecondaryIndexUpdates :: Lens' UpdateTable [GlobalSecondaryIndexUpdate] utGlobalSecondaryIndexUpdates = lens _utGlobalSecondaryIndexUpdates