moto 5.0.3.dev2__py2.py3-none-any.whl → 5.0.3.dev3__py2.py3-none-any.whl
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.
- moto/__init__.py +1 -1
- moto/apigateway/models.py +19 -4
- {moto-5.0.3.dev2.dist-info → moto-5.0.3.dev3.dist-info}/METADATA +1 -1
- {moto-5.0.3.dev2.dist-info → moto-5.0.3.dev3.dist-info}/RECORD +9 -9
- {moto-5.0.3.dev2.dist-info → moto-5.0.3.dev3.dist-info}/AUTHORS.md +0 -0
- {moto-5.0.3.dev2.dist-info → moto-5.0.3.dev3.dist-info}/LICENSE +0 -0
- {moto-5.0.3.dev2.dist-info → moto-5.0.3.dev3.dist-info}/WHEEL +0 -0
- {moto-5.0.3.dev2.dist-info → moto-5.0.3.dev3.dist-info}/entry_points.txt +0 -0
- {moto-5.0.3.dev2.dist-info → moto-5.0.3.dev3.dist-info}/top_level.txt +0 -0
moto/__init__.py
CHANGED
moto/apigateway/models.py
CHANGED
|
@@ -874,21 +874,29 @@ class UsagePlan(BaseModel):
|
|
|
874
874
|
for op in patch_operations:
|
|
875
875
|
path = op["path"]
|
|
876
876
|
value = op["value"]
|
|
877
|
+
if op["op"] == "add":
|
|
878
|
+
if path == "/apiStages":
|
|
879
|
+
self.api_stages.append(
|
|
880
|
+
{"apiId": value.split(":")[0], "stage": value.split(":")[1]}
|
|
881
|
+
)
|
|
877
882
|
if op["op"] == "replace":
|
|
878
883
|
if "/name" in path:
|
|
879
884
|
self.name = value
|
|
880
|
-
if "/productCode" in path:
|
|
881
|
-
self.product_code = value
|
|
882
885
|
if "/description" in path:
|
|
883
886
|
self.description = value
|
|
887
|
+
if op["op"] in ["add", "replace"]:
|
|
888
|
+
if "/productCode" in path:
|
|
889
|
+
self.product_code = value
|
|
884
890
|
if "/quota/limit" in path:
|
|
885
891
|
self.quota["limit"] = value
|
|
886
892
|
if "/quota/period" in path:
|
|
887
893
|
self.quota["period"] = value
|
|
894
|
+
if path == "/quota/offset":
|
|
895
|
+
self.quota["offset"] = value
|
|
888
896
|
if "/throttle/rateLimit" in path:
|
|
889
|
-
self.throttle["rateLimit"] = value
|
|
897
|
+
self.throttle["rateLimit"] = int(value)
|
|
890
898
|
if "/throttle/burstLimit" in path:
|
|
891
|
-
self.throttle["burstLimit"] = value
|
|
899
|
+
self.throttle["burstLimit"] = int(value)
|
|
892
900
|
|
|
893
901
|
|
|
894
902
|
class RequestValidator(BaseModel):
|
|
@@ -2103,6 +2111,13 @@ class APIGatewayBackend(BaseBackend):
|
|
|
2103
2111
|
return self.usage_plans[usage_plan_id]
|
|
2104
2112
|
|
|
2105
2113
|
def update_usage_plan(self, usage_plan_id: str, patch_operations: Any) -> UsagePlan:
|
|
2114
|
+
"""
|
|
2115
|
+
The following PatchOperations are currently supported:
|
|
2116
|
+
add : Everything except /apiStages/{apidId:stageName}/throttle/ and children
|
|
2117
|
+
replace: Everything except /apiStages/{apidId:stageName}/throttle/ and children
|
|
2118
|
+
remove : Nothing yet
|
|
2119
|
+
copy : Nothing yet
|
|
2120
|
+
"""
|
|
2106
2121
|
if usage_plan_id not in self.usage_plans:
|
|
2107
2122
|
raise UsagePlanNotFoundException()
|
|
2108
2123
|
self.usage_plans[usage_plan_id].apply_patch_operations(patch_operations)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
moto/__init__.py,sha256=
|
|
1
|
+
moto/__init__.py,sha256=MdlhxQPK4ql7Xz3EWGnYt_n4motlO2oV-eL88ghIm7c,100
|
|
2
2
|
moto/backend_index.py,sha256=0ZXW2MoTfOl-F3w0DiRCg4XefVIWvLgAmZW-3Pcx7f4,10951
|
|
3
3
|
moto/backends.py,sha256=uM9-6lJ6cqPJuKKFymnhidN1iqslTmOUfnYDT3mvOPI,24575
|
|
4
4
|
moto/proxy.py,sha256=eInoY959PkcnUvc6Xj0zDryvuAgn0bZcxDZvueXwLMA,3133
|
|
@@ -24,7 +24,7 @@ moto/amp/urls.py,sha256=JDjRNUVKNkIAhGg7ExbA8ywOC974m-CqxOkpJ5lJIRQ,1134
|
|
|
24
24
|
moto/amp/utils.py,sha256=lMM1u65ObFPo3Mw98k2UY3pOvCaZn_ZQGAcEHg8RnH0,476
|
|
25
25
|
moto/apigateway/__init__.py,sha256=tRWMHLECsgHToe14Gzcm7la4pq4AN2czolhFjx-BoM4,54
|
|
26
26
|
moto/apigateway/exceptions.py,sha256=3yHGYz7EmgzVA2luIARpeC2yGocZIIa7ecBHIsL-Z78,7521
|
|
27
|
-
moto/apigateway/models.py,sha256=
|
|
27
|
+
moto/apigateway/models.py,sha256=9W5ybiIBwQLd0jHwU-WcYcrvg4cZN3cxbNJAJG5teS8,92502
|
|
28
28
|
moto/apigateway/responses.py,sha256=sMec2KjK41hueNBonY1zzCbkPWNhkATCWG8mND61k6Q,40047
|
|
29
29
|
moto/apigateway/urls.py,sha256=3O5PQn3_qLvOC40lPGJwXonPbamFvgJkJhL8_VO9rdA,5712
|
|
30
30
|
moto/apigateway/utils.py,sha256=-A4kKMiM03Cav6XdiQ3diVL9s0InwaWgfmJBM_7W2Ag,609
|
|
@@ -1070,10 +1070,10 @@ moto/xray/mock_client.py,sha256=_hckCof1BgtizZ4u-Da0tpXX9JNGTbVs7AhbkxBnuGU,3811
|
|
|
1070
1070
|
moto/xray/models.py,sha256=NbevJjH4Qly1A6YM0SswSv7gTBc44547Zl5XnRMd84s,11229
|
|
1071
1071
|
moto/xray/responses.py,sha256=StNwTGhzvkqCmghSo2O9tMfTRQSN4BWYzLODyKMUj-s,6316
|
|
1072
1072
|
moto/xray/urls.py,sha256=R6T3gMwobWipukWcC1DQ36CU1Rjt6oqBDoe-7HqaIZU,393
|
|
1073
|
-
moto-5.0.3.
|
|
1074
|
-
moto-5.0.3.
|
|
1075
|
-
moto-5.0.3.
|
|
1076
|
-
moto-5.0.3.
|
|
1077
|
-
moto-5.0.3.
|
|
1078
|
-
moto-5.0.3.
|
|
1079
|
-
moto-5.0.3.
|
|
1073
|
+
moto-5.0.3.dev3.dist-info/AUTHORS.md,sha256=dDUhasV8HGSkzb7zj7a0b3alnqY0P1LPOyOUNoo8Mpo,2976
|
|
1074
|
+
moto-5.0.3.dev3.dist-info/LICENSE,sha256=8S75_TlqE-kIeGMLG0-rRxxu2ct6SM8quyUWKBYyIY4,10834
|
|
1075
|
+
moto-5.0.3.dev3.dist-info/METADATA,sha256=dX1YoTvDgSJlHeLC-frHqTwTQex3a0B1HoIrGW1Thkw,11942
|
|
1076
|
+
moto-5.0.3.dev3.dist-info/WHEEL,sha256=-G_t0oGuE7UD0DrSpVZnq1hHMBV9DD2XkS5v7XpmTnk,110
|
|
1077
|
+
moto-5.0.3.dev3.dist-info/entry_points.txt,sha256=QWCojULQb54Hi_2KamEEYHA6Cwek_vN685aS8DbI9rU,78
|
|
1078
|
+
moto-5.0.3.dev3.dist-info/top_level.txt,sha256=TETRKAPcAAvoZDkSkwQiZtTSr-1gzaEAXVm9FmZKj8s,5
|
|
1079
|
+
moto-5.0.3.dev3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|