You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -65,6 +88,11 @@ public extension BreezeDynamoDBManager {
65
88
letoldUpdatedAt:String
66
89
}
67
90
91
+
/// Updates an existing item in the DynamoDB table.
92
+
/// - Parameter item: The item to update, conforming to the BreezeCodable protocol.
93
+
/// - Returns: The updated item, with its `updatedAt` timestamp set to the current date.
94
+
/// - Throws: An error if the item cannot be updated, such as if the item does not exist or the condition fails.
95
+
/// - Important: The update operation checks that the `updatedAt` and `createdAt` timestamps match the existing values to prevent concurrent modifications.
@@ -82,6 +110,10 @@ public extension BreezeDynamoDBManager {
82
110
returntryawaitreadItem(key: item.key)
83
111
}
84
112
113
+
/// Deletes an item from the DynamoDB table.
114
+
/// - Parameter item: The item to delete, conforming to the BreezeCodable protocol.
115
+
/// - Throws: An error if the item cannot be deleted, such as if the item does not exist or the condition fails.
116
+
/// - Important: The `updatedAt` and `createdAt` timestamps must be set on the item to ensure safe deletion. This method checks that the `updatedAt` and `createdAt` timestamps match the existing values to prevent concurrent modifications.
@@ -101,6 +133,13 @@ public extension BreezeDynamoDBManager {
101
133
return
102
134
}
103
135
136
+
/// Lists items in the DynamoDB table with optional pagination.
137
+
/// - Parameters:
138
+
/// - key: An optional key to start the listing from, useful for pagination.
139
+
/// - limit: An optional limit on the number of items to return.
140
+
/// - Returns: A `ListResponse` containing the items and the last evaluated key for pagination.
141
+
/// - Throws: An error if the listing operation fails.
142
+
/// - Important: The `key` parameter is used to continue listing from a specific point, and the `limit` parameter controls how many items are returned in one call.
/// Gracefully shutdown the service and its components.
85
+
/// - Throws: An error if the shutdown process fails.
86
+
/// This method ensures that the AWS client and HTTP client are properly shutdown before marking the service as shutdown.
87
+
/// It also logs the shutdown process.
88
+
/// This method is idempotent;
89
+
/// - Important: This method must be called at leat once to ensure that resources are released properly. If the method is not called, it will lead to a crash.
/// - items: An array of items returned from the DynamoDB operation.
29
+
/// - lastEvaluatedKey: An optional string representing the last evaluated key for pagination. If nil, it indicates that there are no more items to fetch.
30
+
///
31
+
/// This initializer is used to create a paginated response for DynamoDB operations.
0 commit comments