omnata-plugin-runtime 0.3.25a78__tar.gz → 0.3.26a79__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {omnata_plugin_runtime-0.3.25a78 → omnata_plugin_runtime-0.3.26a79}/PKG-INFO +1 -1
- {omnata_plugin_runtime-0.3.25a78 → omnata_plugin_runtime-0.3.26a79}/pyproject.toml +1 -1
- {omnata_plugin_runtime-0.3.25a78 → omnata_plugin_runtime-0.3.26a79}/src/omnata_plugin_runtime/omnata_plugin.py +21 -15
- {omnata_plugin_runtime-0.3.25a78 → omnata_plugin_runtime-0.3.26a79}/LICENSE +0 -0
- {omnata_plugin_runtime-0.3.25a78 → omnata_plugin_runtime-0.3.26a79}/README.md +0 -0
- {omnata_plugin_runtime-0.3.25a78 → omnata_plugin_runtime-0.3.26a79}/src/omnata_plugin_runtime/__init__.py +0 -0
- {omnata_plugin_runtime-0.3.25a78 → omnata_plugin_runtime-0.3.26a79}/src/omnata_plugin_runtime/api.py +0 -0
- {omnata_plugin_runtime-0.3.25a78 → omnata_plugin_runtime-0.3.26a79}/src/omnata_plugin_runtime/configuration.py +0 -0
- {omnata_plugin_runtime-0.3.25a78 → omnata_plugin_runtime-0.3.26a79}/src/omnata_plugin_runtime/forms.py +0 -0
- {omnata_plugin_runtime-0.3.25a78 → omnata_plugin_runtime-0.3.26a79}/src/omnata_plugin_runtime/logging.py +0 -0
- {omnata_plugin_runtime-0.3.25a78 → omnata_plugin_runtime-0.3.26a79}/src/omnata_plugin_runtime/plugin_entrypoints.py +0 -0
- {omnata_plugin_runtime-0.3.25a78 → omnata_plugin_runtime-0.3.26a79}/src/omnata_plugin_runtime/rate_limiting.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "omnata-plugin-runtime"
|
3
|
-
version = "0.3.
|
3
|
+
version = "0.3.26-a79"
|
4
4
|
description = "Classes and common runtime components for building and running Omnata Plugins"
|
5
5
|
authors = ["James Weakley <james.weakley@omnata.com>"]
|
6
6
|
readme = "README.md"
|
@@ -1415,6 +1415,10 @@ class MonthlyBillingEventRequest(BaseModel):
|
|
1415
1415
|
# below is deprecated
|
1416
1416
|
has_active_inbound: bool = False
|
1417
1417
|
has_active_outbound: bool = False
|
1418
|
+
# had to add these because the old version of the standard billing events assumed a daily billing event
|
1419
|
+
# TODO: deprecate all of these once the plugins are all on 0.3.26 or higher
|
1420
|
+
billable_connections_inbound: int = 0
|
1421
|
+
billable_connections_outbound: int = 0
|
1418
1422
|
|
1419
1423
|
|
1420
1424
|
BillingEventRequest = Annotated[Union[DailyBillingEventRequest,MonthlyBillingEventRequest],Field(discriminator='billing_schedule')]
|
@@ -1622,27 +1626,29 @@ class OmnataPlugin(ABC):
|
|
1622
1626
|
"""
|
1623
1627
|
sent_initial = False
|
1624
1628
|
events: List[SnowflakeBillingEvent] = []
|
1625
|
-
|
1626
|
-
|
1627
|
-
|
1628
|
-
SnowflakeBillingEvent(
|
1629
|
-
billing_class="DAILY_ACTIVE_INITIAL",
|
1630
|
-
billing_subclass="",
|
1631
|
-
timestamp=datetime.datetime.now(tz=datetime.timezone.utc),
|
1632
|
-
base_charge=initial_charge,
|
1633
|
-
)
|
1634
|
-
)
|
1635
|
-
sent_initial = True
|
1636
|
-
else:
|
1637
|
-
if additional_charge is not None and additional_charge > 0:
|
1629
|
+
if request.billing_schedule == "DAILY":
|
1630
|
+
for i in range(request.billable_connections_inbound + request.billable_connections_outbound):
|
1631
|
+
if sent_initial is False:
|
1638
1632
|
events.append(
|
1639
1633
|
SnowflakeBillingEvent(
|
1640
|
-
billing_class="
|
1634
|
+
billing_class="DAILY_ACTIVE_INITIAL",
|
1641
1635
|
billing_subclass="",
|
1642
1636
|
timestamp=datetime.datetime.now(tz=datetime.timezone.utc),
|
1643
|
-
base_charge=
|
1637
|
+
base_charge=initial_charge,
|
1644
1638
|
)
|
1645
1639
|
)
|
1640
|
+
sent_initial = True
|
1641
|
+
else:
|
1642
|
+
if additional_charge is not None and additional_charge > 0:
|
1643
|
+
events.append(
|
1644
|
+
SnowflakeBillingEvent(
|
1645
|
+
billing_class="DAILY_ACTIVE_ADDITIONAL",
|
1646
|
+
billing_subclass="",
|
1647
|
+
timestamp=datetime.datetime.now(tz=datetime.timezone.utc),
|
1648
|
+
base_charge=additional_charge,
|
1649
|
+
)
|
1650
|
+
)
|
1651
|
+
# handle monthly billing events inside the plugins for now
|
1646
1652
|
return events
|
1647
1653
|
|
1648
1654
|
def additional_loggers(self) -> List[str]:
|
File without changes
|
File without changes
|
File without changes
|
{omnata_plugin_runtime-0.3.25a78 → omnata_plugin_runtime-0.3.26a79}/src/omnata_plugin_runtime/api.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|