boto3-assist 0.16.0__tar.gz → 0.17.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/PKG-INFO +1 -1
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/examples/dynamodb/models/order_item_model.py +7 -7
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/examples/dynamodb/models/order_model.py +7 -7
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/examples/dynamodb/models/product_model.py +9 -7
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/examples/dynamodb/models/user_model.py +7 -7
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/examples/dynamodb/models/user_post_model.py +2 -2
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/pyproject.toml +1 -1
- boto3_assist-0.17.0/src/boto3_assist/version.py +1 -0
- {boto3_assist-0.16.0/tests/unit/dynamodb_tests/dbmodels → boto3_assist-0.17.0/tests/unit/dynamodb_tests/db_models}/cms/base.py +1 -1
- {boto3_assist-0.16.0/tests/unit/dynamodb_tests/dbmodels → boto3_assist-0.17.0/tests/unit/dynamodb_tests/db_models}/cms/content_block.py +8 -8
- {boto3_assist-0.16.0/tests/unit/dynamodb_tests/dbmodels → boto3_assist-0.17.0/tests/unit/dynamodb_tests/db_models}/cms/page.py +9 -9
- {boto3_assist-0.16.0/tests/unit/dynamodb_tests/dbmodels → boto3_assist-0.17.0/tests/unit/dynamodb_tests/db_models}/cms/template.py +11 -9
- {boto3_assist-0.16.0/tests/unit/dynamodb_tests/dbmodels → boto3_assist-0.17.0/tests/unit/dynamodb_tests/db_models}/user_model.py +6 -6
- {boto3_assist-0.16.0/tests/unit/dynamodb_tests/dbmodels → boto3_assist-0.17.0/tests/unit/dynamodb_tests/db_models}/user_required_fields_model.py +6 -6
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/dynamodb_tests/dynamodb_model_base_test.py +4 -4
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/dynamodb_tests/dynamodb_model_projections_test.py +5 -5
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/dynamodb_tests/dynamodb_model_serializtion_test.py +4 -4
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/dynamodb_tests/dynamodb_moto_sorting_test.py +2 -2
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/utilities/serialization_utility_test.py +3 -3
- boto3_assist-0.16.0/src/boto3_assist/version.py +0 -1
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/.env.docker +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/.env.docker.001 +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/.env.docker.nosql.workbench +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/.env.unittest +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/.gitignore +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/.vscode/launch.json +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/.vscode/settings.json +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/.vscode/tasks.json +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/LICENSE-EXPLAINED.txt +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/LICENSE.txt +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/README.md +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/aws_regions_with_status.csv +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/aws_regions_with_status.json +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/devops/build.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/devops/readme.md +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/examples/__init__.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/examples/cloudwatch/log_report.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/examples/dynamodb/order_example/main.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/examples/dynamodb/order_example/products.json +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/examples/dynamodb/services/order_item_service.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/examples/dynamodb/services/order_service.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/examples/dynamodb/services/product_service.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/examples/dynamodb/services/table_service.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/examples/dynamodb/services/user_post_service.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/examples/dynamodb/services/user_service.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/examples/dynamodb/services/user_service_client_example.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/examples/dynamodb/services/user_service_resource_example.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/examples/dynamodb/user_post_example/main.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/examples/ec2/regions_report.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/module-headers.txt +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/mypy.ini +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/requirements-dev.txt +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/requirements.txt +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/run-checks.sh +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/run_unit_tests.sh +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/__init__.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/aws_config.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/aws_lambda/event_info.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/aws_lambda/mock_context.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/boto3session.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/cloudwatch/cloudwatch_connection.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/cloudwatch/cloudwatch_connection_tracker.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/cloudwatch/cloudwatch_log_connection.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/cloudwatch/cloudwatch_logs.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/cloudwatch/cloudwatch_query.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/cognito/cognito_authorizer.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/cognito/cognito_connection.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/cognito/cognito_utility.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/cognito/jwks_cache.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/cognito/user.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/connection.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/connection_tracker.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/dynamodb/dynamodb.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/dynamodb/dynamodb_connection.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/dynamodb/dynamodb_helpers.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/dynamodb/dynamodb_importer.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/dynamodb/dynamodb_index.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/dynamodb/dynamodb_iservice.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/dynamodb/dynamodb_key.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/dynamodb/dynamodb_model_base.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/dynamodb/dynamodb_model_base_interfaces.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/dynamodb/dynamodb_reindexer.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/dynamodb/dynamodb_reserved_words.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/dynamodb/dynamodb_reserved_words.txt +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/dynamodb/readme.md +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/dynamodb/troubleshooting.md +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/ec2/ec2_connection.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/environment_services/__init__.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/environment_services/environment_loader.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/environment_services/environment_variables.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/errors/custom_exceptions.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/http_status_codes.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/models/serializable_model.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/role_assumption_mixin.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/s3/s3.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/s3/s3_bucket.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/s3/s3_connection.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/s3/s3_event_data.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/s3/s3_object.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/securityhub/securityhub.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/securityhub/securityhub_connection.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/session_setup_mixin.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/ssm/connection.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/ssm/parameter_store/parameter_store.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/utilities/datetime_utility.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/utilities/dictionary_utility.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/utilities/file_operations.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/utilities/http_utility.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/utilities/logging_utility.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/utilities/numbers_utility.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/utilities/serialization_utility.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/utilities/string_utility.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/__init__.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/integration/cross_account_connection_test.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/integration/tenant.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/integration/tenant_services.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/aws_config_test.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/dynamodb_tests/__init__.py +0 -0
- {boto3_assist-0.16.0/tests/unit/dynamodb_tests/dbmodels → boto3_assist-0.17.0/tests/unit/dynamodb_tests/db_models}/simple_model.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/dynamodb_tests/dynamodb_reindex_test.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/examples_test/__init__.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/examples_test/user_service_test.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/lambda_tests/__init__.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/lambda_tests/event_info_test.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/models_tests/__init__.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/models_tests/models/person.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/models_tests/models/user.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/models_tests/serializable_model_person_test.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/models_tests/serializable_model_user_test.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/models_tests/serializable_model_wide_test.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/parameter_store/__init__.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/parameter_store/parameter_store_test.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/s3/__init__.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/s3/files/test.txt +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/s3/s3_event_data_test.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/s3/s3_file_delete_test.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/s3/s3_file_upload_test.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/session_tests/test_boto3_session_manager.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/utilities/__init__.py +0 -0
- {boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/utilities/string_utility_test.py +0 -0
|
@@ -36,15 +36,15 @@ class OrderItem(DynamoDBModelBase):
|
|
|
36
36
|
# the primary key will be made off of the
|
|
37
37
|
# order.id and this item.id
|
|
38
38
|
# this will allow for a 1 to many search on the items related to an order
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
primary: DynamoDBIndex = DynamoDBIndex()
|
|
40
|
+
primary.name = "primary"
|
|
41
41
|
# create a partition key off of the order key
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
primary.partition_key.attribute_name = "pk"
|
|
43
|
+
primary.partition_key.value = lambda: DynamoDBKey.build_key(
|
|
44
44
|
("order", self.order_id)
|
|
45
45
|
)
|
|
46
46
|
|
|
47
47
|
# create the sort key off of this items id
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
self.indexes.add_primary(
|
|
48
|
+
primary.sort_key.attribute_name = "sk"
|
|
49
|
+
primary.sort_key.value = lambda: DynamoDBKey.build_key(("item", self.id))
|
|
50
|
+
self.indexes.add_primary(primary)
|
|
@@ -43,13 +43,13 @@ class Order(DynamoDBModelBase):
|
|
|
43
43
|
|
|
44
44
|
def __setup_indexes(self):
|
|
45
45
|
# user id
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
self.indexes.add_primary(
|
|
46
|
+
primary: DynamoDBIndex = DynamoDBIndex()
|
|
47
|
+
primary.name = "primary"
|
|
48
|
+
primary.partition_key.attribute_name = "pk"
|
|
49
|
+
primary.partition_key.value = lambda: DynamoDBKey.build_key(("order", self.id))
|
|
50
|
+
primary.sort_key.attribute_name = "sk"
|
|
51
|
+
primary.sort_key.value = lambda: DynamoDBKey.build_key(("order", self.id))
|
|
52
|
+
self.indexes.add_primary(primary)
|
|
53
53
|
|
|
54
54
|
# all orders on a given day, sort by created date
|
|
55
55
|
self.indexes.add_secondary(
|
|
@@ -33,13 +33,15 @@ class Product(DynamoDBModelBase):
|
|
|
33
33
|
return f"{self.name} - ${self.price}"
|
|
34
34
|
|
|
35
35
|
def __setup_indexes(self):
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
primary: DynamoDBIndex = DynamoDBIndex()
|
|
37
|
+
primary.name = "primary"
|
|
38
|
+
primary.partition_key.attribute_name = "pk"
|
|
39
|
+
primary.partition_key.value = lambda: DynamoDBKey.build_key(
|
|
40
|
+
("product", self.id)
|
|
41
|
+
)
|
|
42
|
+
primary.sort_key.attribute_name = "sk"
|
|
43
|
+
primary.sort_key.value = lambda: DynamoDBKey.build_key(("product", self.id))
|
|
44
|
+
self.indexes.add_primary(primary)
|
|
43
45
|
|
|
44
46
|
self.indexes.add_secondary(
|
|
45
47
|
DynamoDBIndex(
|
|
@@ -31,13 +31,13 @@ class User(DynamoDBModelBase):
|
|
|
31
31
|
|
|
32
32
|
def __setup_indexes(self):
|
|
33
33
|
# user id
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
self.indexes.add_primary(
|
|
34
|
+
primary: DynamoDBIndex = DynamoDBIndex()
|
|
35
|
+
primary.name = "primary"
|
|
36
|
+
primary.partition_key.attribute_name = "pk"
|
|
37
|
+
primary.partition_key.value = lambda: DynamoDBKey.build_key(("user", self.id))
|
|
38
|
+
primary.sort_key.attribute_name = "sk"
|
|
39
|
+
primary.sort_key.value = lambda: DynamoDBKey.build_key(("user", self.id))
|
|
40
|
+
self.indexes.add_primary(primary)
|
|
41
41
|
|
|
42
42
|
# find all users by email address
|
|
43
43
|
gsi0: DynamoDBIndex = DynamoDBIndex(
|
|
@@ -33,7 +33,7 @@ class UserPost(DynamoDBModelBase):
|
|
|
33
33
|
self.__setup_indexes()
|
|
34
34
|
|
|
35
35
|
def __setup_indexes(self):
|
|
36
|
-
|
|
36
|
+
primary: DynamoDBIndex = DynamoDBIndex(
|
|
37
37
|
index_name="primary",
|
|
38
38
|
partition_key=DynamoDBKey(
|
|
39
39
|
attribute_name="pk",
|
|
@@ -44,7 +44,7 @@ class UserPost(DynamoDBModelBase):
|
|
|
44
44
|
value=lambda: f"post#{self.slug if self.slug else ''}",
|
|
45
45
|
),
|
|
46
46
|
)
|
|
47
|
-
self.indexes.add_primary(
|
|
47
|
+
self.indexes.add_primary(primary)
|
|
48
48
|
|
|
49
49
|
gsi0: DynamoDBIndex = DynamoDBIndex(
|
|
50
50
|
index_name="gsi0",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '0.17.0'
|
|
@@ -15,7 +15,7 @@ from boto3_assist.dynamodb.dynamodb_model_base import (
|
|
|
15
15
|
class BaseCMSDBModel(DynamoDBModelBase):
|
|
16
16
|
"""
|
|
17
17
|
The Base DB Model
|
|
18
|
-
Sets a common set of
|
|
18
|
+
Sets a common set of properties for all models
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
21
|
def __init__(self) -> None:
|
|
@@ -7,7 +7,7 @@ MIT License. See Project Root for the license information.
|
|
|
7
7
|
import datetime as dt
|
|
8
8
|
from boto3_assist.dynamodb.dynamodb_index import DynamoDBIndex, DynamoDBKey
|
|
9
9
|
from boto3_assist.utilities.string_utility import StringUtility
|
|
10
|
-
from tests.unit.dynamodb_tests.
|
|
10
|
+
from tests.unit.dynamodb_tests.db_models.cms.base import BaseCMSDBModel
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class ContentBlock(BaseCMSDBModel):
|
|
@@ -41,13 +41,13 @@ class ContentBlock(BaseCMSDBModel):
|
|
|
41
41
|
self.__setup_indexes()
|
|
42
42
|
|
|
43
43
|
def __setup_indexes(self):
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
primary: DynamoDBIndex = DynamoDBIndex()
|
|
45
|
+
primary.name = "primary"
|
|
46
|
+
primary.partition_key.attribute_name = "pk"
|
|
47
|
+
primary.partition_key.value = lambda: DynamoDBKey.build_key(
|
|
48
48
|
("site", self.site_id), ("block-type", self.block_type)
|
|
49
49
|
)
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
self.indexes.add_primary(
|
|
51
|
+
primary.sort_key.attribute_name = "sk"
|
|
52
|
+
primary.sort_key.value = lambda: DynamoDBKey.build_key(("content", self.id))
|
|
53
|
+
self.indexes.add_primary(primary)
|
|
@@ -7,7 +7,7 @@ MIT License. See Project Root for the license information.
|
|
|
7
7
|
from typing import List, Dict, Any
|
|
8
8
|
import datetime as dt
|
|
9
9
|
from boto3_assist.dynamodb.dynamodb_index import DynamoDBIndex, DynamoDBKey
|
|
10
|
-
from tests.unit.dynamodb_tests.
|
|
10
|
+
from tests.unit.dynamodb_tests.db_models.cms.base import BaseCMSDBModel
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class Page(BaseCMSDBModel):
|
|
@@ -45,16 +45,16 @@ class Page(BaseCMSDBModel):
|
|
|
45
45
|
self.__setup_indexes()
|
|
46
46
|
|
|
47
47
|
def __setup_indexes(self):
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
primary: DynamoDBIndex = DynamoDBIndex()
|
|
49
|
+
primary.name = "primary"
|
|
50
|
+
primary.partition_key.attribute_name = "pk"
|
|
51
|
+
primary.partition_key.value = lambda: DynamoDBKey.build_key(
|
|
52
52
|
("site", self.site_id), ("pages", None)
|
|
53
53
|
)
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
self.indexes.add_primary(
|
|
55
|
+
primary.sort_key.attribute_name = "sk"
|
|
56
|
+
primary.sort_key.value = lambda: DynamoDBKey.build_key(("page", self.slug))
|
|
57
|
+
self.indexes.add_primary(primary)
|
|
58
58
|
|
|
59
59
|
gsi1: DynamoDBIndex = DynamoDBIndex()
|
|
60
60
|
gsi1.name = "gsi1"
|
|
@@ -69,7 +69,7 @@ class Page(BaseCMSDBModel):
|
|
|
69
69
|
@property
|
|
70
70
|
def id(self) -> str:
|
|
71
71
|
"""The id for the page"""
|
|
72
|
-
return f"{self.site_id}/{self.slug}"
|
|
72
|
+
return f"{self.site_id}/{self.type}/{self.slug}"
|
|
73
73
|
|
|
74
74
|
@id.setter
|
|
75
75
|
def id(self, id: str):
|
|
@@ -6,7 +6,7 @@ MIT License. See Project Root for the license information.
|
|
|
6
6
|
|
|
7
7
|
from typing import List
|
|
8
8
|
from boto3_assist.dynamodb.dynamodb_index import DynamoDBIndex, DynamoDBKey
|
|
9
|
-
from tests.unit.dynamodb_tests.
|
|
9
|
+
from tests.unit.dynamodb_tests.db_models.cms.base import BaseCMSDBModel
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class Template(BaseCMSDBModel):
|
|
@@ -28,16 +28,16 @@ class Template(BaseCMSDBModel):
|
|
|
28
28
|
self.__setup_indexes()
|
|
29
29
|
|
|
30
30
|
def __setup_indexes(self):
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
primary: DynamoDBIndex = DynamoDBIndex()
|
|
32
|
+
primary.name = "primary"
|
|
33
|
+
primary.partition_key.attribute_name = "pk"
|
|
34
|
+
primary.partition_key.value = lambda: DynamoDBKey.build_key(
|
|
35
35
|
("site", self.site_id), ("templates", None)
|
|
36
36
|
)
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
self.indexes.add_primary(
|
|
38
|
+
primary.sort_key.attribute_name = "sk"
|
|
39
|
+
primary.sort_key.value = lambda: DynamoDBKey.build_key(("template", self.title))
|
|
40
|
+
self.indexes.add_primary(primary)
|
|
41
41
|
|
|
42
42
|
gsi1: DynamoDBIndex = DynamoDBIndex()
|
|
43
43
|
gsi1.name = "gsi1"
|
|
@@ -52,8 +52,10 @@ class Template(BaseCMSDBModel):
|
|
|
52
52
|
@property
|
|
53
53
|
def s3_object_key(self) -> str:
|
|
54
54
|
"""The s3 object key for the template"""
|
|
55
|
-
return f"{self.site_id}/{self.title}"
|
|
55
|
+
return f"{self.site_id}/template/{self.type}/{self.title}"
|
|
56
56
|
|
|
57
57
|
@s3_object_key.setter
|
|
58
58
|
def s3_object_key(self, value: str):
|
|
59
|
+
# we don't set this field, but we also don't
|
|
60
|
+
# want an error during the serialization process
|
|
59
61
|
pass
|
|
@@ -30,13 +30,13 @@ class User(DynamoDBModelBase):
|
|
|
30
30
|
self.__setup_indexes()
|
|
31
31
|
|
|
32
32
|
def __setup_indexes(self):
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
primary: DynamoDBIndex = DynamoDBIndex()
|
|
34
|
+
primary.partition_key.attribute_name = "pk"
|
|
35
35
|
# allows for a wild card search on all "sites"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
self.indexes.add_primary(
|
|
36
|
+
primary.partition_key.value = lambda: DynamoDBKey.build_key(("user", self.id))
|
|
37
|
+
primary.sort_key.attribute_name = "sk"
|
|
38
|
+
primary.sort_key.value = lambda: DynamoDBKey.build_key(("user", self.id))
|
|
39
|
+
self.indexes.add_primary(primary)
|
|
40
40
|
|
|
41
41
|
gsi0: DynamoDBIndex = DynamoDBIndex(index_name="gsi0")
|
|
42
42
|
gsi0.partition_key.attribute_name = "gsi0_pk"
|
|
@@ -30,13 +30,13 @@ class User(DynamoDBModelBase):
|
|
|
30
30
|
self.__setup_indexes()
|
|
31
31
|
|
|
32
32
|
def __setup_indexes(self):
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
primary: DynamoDBIndex = DynamoDBIndex()
|
|
34
|
+
primary.partition_key.attribute_name = "pk"
|
|
35
35
|
# allows for a wild card search on all "sites"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
self.indexes.add_primary(
|
|
36
|
+
primary.partition_key.value = lambda: DynamoDBKey.build_key(("user", self.id))
|
|
37
|
+
primary.sort_key.attribute_name = "sk"
|
|
38
|
+
primary.sort_key.value = lambda: DynamoDBKey.build_key(("user", self.id))
|
|
39
|
+
self.indexes.add_primary(primary)
|
|
40
40
|
|
|
41
41
|
gsi0: DynamoDBIndex = DynamoDBIndex(index_name="gsi0")
|
|
42
42
|
gsi0.partition_key.attribute_name = "gsi0_pk"
|
{boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/dynamodb_tests/dynamodb_model_base_test.py
RENAMED
|
@@ -9,14 +9,14 @@ from typing import Dict, List
|
|
|
9
9
|
|
|
10
10
|
from boto3_assist.dynamodb.dynamodb_index import DynamoDBIndex
|
|
11
11
|
from boto3_assist.dynamodb.dynamodb_key import DynamoDBKey
|
|
12
|
-
from tests.unit.dynamodb_tests.
|
|
12
|
+
from tests.unit.dynamodb_tests.db_models.user_model import User
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class DynamoDBModelUnitTest(unittest.TestCase):
|
|
16
16
|
"Serialization Tests"
|
|
17
17
|
|
|
18
18
|
def test_basic_serialization(self):
|
|
19
|
-
"""Test Basic
|
|
19
|
+
"""Test Basic Serialization"""
|
|
20
20
|
# Arrange
|
|
21
21
|
data = {
|
|
22
22
|
"id": "123456",
|
|
@@ -39,7 +39,7 @@ class DynamoDBModelUnitTest(unittest.TestCase):
|
|
|
39
39
|
self.assertIsInstance(key, dict)
|
|
40
40
|
|
|
41
41
|
def test_object_serialization_map(self):
|
|
42
|
-
"""Test Basic
|
|
42
|
+
"""Test Basic Serialization"""
|
|
43
43
|
# Arrange
|
|
44
44
|
data = {
|
|
45
45
|
"id": "123456",
|
|
@@ -60,7 +60,7 @@ class DynamoDBModelUnitTest(unittest.TestCase):
|
|
|
60
60
|
self.assertIsInstance(serialized_data, User)
|
|
61
61
|
|
|
62
62
|
def test_new_key_design_serialization_map(self):
|
|
63
|
-
"""Test Basic
|
|
63
|
+
"""Test Basic Serialization"""
|
|
64
64
|
# Arrange
|
|
65
65
|
data = {
|
|
66
66
|
"id": "123456",
|
|
@@ -7,15 +7,15 @@ MIT License. See Project Root for the license information.
|
|
|
7
7
|
import unittest
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
from tests.unit.dynamodb_tests.
|
|
11
|
-
from tests.unit.dynamodb_tests.
|
|
10
|
+
from tests.unit.dynamodb_tests.db_models.user_model import User
|
|
11
|
+
from tests.unit.dynamodb_tests.db_models.simple_model import Simple
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
class
|
|
14
|
+
class DynamoDBModeProjectionUnitTest(unittest.TestCase):
|
|
15
15
|
"Serialization Tests"
|
|
16
16
|
|
|
17
17
|
def test_projection_expressions_transformation(self):
|
|
18
|
-
"""Test Basic
|
|
18
|
+
"""Test Basic Serialization"""
|
|
19
19
|
# Arrange
|
|
20
20
|
data = {
|
|
21
21
|
"id": "123456",
|
|
@@ -53,7 +53,7 @@ class DynamoDBModeProjectionlUnitTest(unittest.TestCase):
|
|
|
53
53
|
self.assertIn("status", attribute_names["#status"])
|
|
54
54
|
|
|
55
55
|
def test_simple_model(self):
|
|
56
|
-
"""Test Basic
|
|
56
|
+
"""Test Basic Serialization"""
|
|
57
57
|
# Arrange
|
|
58
58
|
data = {
|
|
59
59
|
"id": "123456",
|
|
@@ -7,15 +7,15 @@ MIT License. See Project Root for the license information.
|
|
|
7
7
|
import unittest
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
from tests.unit.dynamodb_tests.
|
|
11
|
-
from tests.unit.dynamodb_tests.
|
|
10
|
+
from tests.unit.dynamodb_tests.db_models.user_model import User
|
|
11
|
+
from tests.unit.dynamodb_tests.db_models.user_required_fields_model import User as User2
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
class
|
|
14
|
+
class Dynamodb_Model_SerializationUnitTest(unittest.TestCase):
|
|
15
15
|
"Serialization Tests"
|
|
16
16
|
|
|
17
17
|
def test_basic_serialization(self):
|
|
18
|
-
"""Test Basic
|
|
18
|
+
"""Test Basic Serialization"""
|
|
19
19
|
# Arrange
|
|
20
20
|
data = {
|
|
21
21
|
"id": "123456",
|
{boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/dynamodb_tests/dynamodb_moto_sorting_test.py
RENAMED
|
@@ -12,11 +12,11 @@ from mypy_boto3_dynamodb import DynamoDBClient
|
|
|
12
12
|
|
|
13
13
|
from boto3_assist.dynamodb.dynamodb import DynamoDB
|
|
14
14
|
from boto3_assist.environment_services.environment_loader import EnvironmentLoader
|
|
15
|
-
from tests.unit.dynamodb_tests.
|
|
15
|
+
from tests.unit.dynamodb_tests.db_models.cms.page import Page
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
@moto.mock_aws
|
|
19
|
-
class
|
|
19
|
+
class DynamoDB_SortingUnitTest(unittest.TestCase):
|
|
20
20
|
"Sorting Tests"
|
|
21
21
|
|
|
22
22
|
def __init__(self, methodName="runTest"):
|
{boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/utilities/serialization_utility_test.py
RENAMED
|
@@ -191,7 +191,7 @@ class SerializationUnitTest(unittest.TestCase):
|
|
|
191
191
|
"Serialization Tests"
|
|
192
192
|
|
|
193
193
|
def test_basic_serialization(self):
|
|
194
|
-
"""Test Basic
|
|
194
|
+
"""Test Basic Serialization"""
|
|
195
195
|
# Arrange
|
|
196
196
|
data = {
|
|
197
197
|
"name": "John Doe",
|
|
@@ -219,7 +219,7 @@ class SerializationUnitTest(unittest.TestCase):
|
|
|
219
219
|
self.assertEqual(user.authorization.groups[0], "Admin")
|
|
220
220
|
|
|
221
221
|
def test_object_serialization_map(self):
|
|
222
|
-
"""Test Basic
|
|
222
|
+
"""Test Basic Serialization"""
|
|
223
223
|
# Arrange
|
|
224
224
|
data = {"name": "John Doe", "age": 30, "email": "john@example.com"}
|
|
225
225
|
|
|
@@ -233,7 +233,7 @@ class SerializationUnitTest(unittest.TestCase):
|
|
|
233
233
|
self.assertEqual(serialized_data.email, "john@example.com")
|
|
234
234
|
|
|
235
235
|
def test_object_serialization_map_resource(self):
|
|
236
|
-
"""Ensure the db properties aren't carried over to sub objects during
|
|
236
|
+
"""Ensure the db properties aren't carried over to sub objects during Serialization"""
|
|
237
237
|
# Arrange
|
|
238
238
|
subscription: Subscription = Subscription()
|
|
239
239
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '0.16.0'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{boto3_assist-0.16.0 → boto3_assist-0.17.0}/examples/dynamodb/services/order_item_service.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/cloudwatch/cloudwatch_connection.py
RENAMED
|
File without changes
|
|
File without changes
|
{boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/cloudwatch/cloudwatch_log_connection.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/dynamodb/dynamodb_connection.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/dynamodb/dynamodb_model_base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/dynamodb/dynamodb_reserved_words.py
RENAMED
|
File without changes
|
{boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/dynamodb/dynamodb_reserved_words.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/environment_services/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/securityhub/securityhub_connection.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/ssm/parameter_store/parameter_store.py
RENAMED
|
File without changes
|
|
File without changes
|
{boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/utilities/dictionary_utility.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{boto3_assist-0.16.0 → boto3_assist-0.17.0}/src/boto3_assist/utilities/serialization_utility.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/integration/cross_account_connection_test.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/dynamodb_tests/dynamodb_reindex_test.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/models_tests/serializable_model_user_test.py
RENAMED
|
File without changes
|
{boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/models_tests/serializable_model_wide_test.py
RENAMED
|
File without changes
|
|
File without changes
|
{boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/parameter_store/parameter_store_test.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{boto3_assist-0.16.0 → boto3_assist-0.17.0}/tests/unit/session_tests/test_boto3_session_manager.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|