omnata-plugin-runtime 0.3.9a20__py3-none-any.whl → 0.3.9a23__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.
@@ -4,6 +4,15 @@ Omnata Plugin Runtime.
4
4
  Includes data container classes and defines the contract for a plugin.
5
5
  """
6
6
  from __future__ import annotations
7
+ import sys
8
+ from typing import Union
9
+ if tuple(sys.version_info[:2]) >= (3, 9):
10
+ # Python 3.9 and above
11
+ from typing import Annotated # pylint: disable=ungrouped-imports
12
+ else:
13
+ # Python 3.8 and below
14
+ from typing_extensions import Annotated
15
+
7
16
 
8
17
  import datetime
9
18
  import http
@@ -20,7 +29,7 @@ import jinja2
20
29
  import pandas
21
30
  import pydantic
22
31
  import pydantic.json
23
- from pydantic import parse_obj_as, root_validator
32
+ from pydantic import Field, parse_obj_as, root_validator
24
33
  from dateutil.parser import parse
25
34
  from jinja2 import Environment
26
35
  from pydantic import BaseModel # pylint: disable=no-name-in-module
@@ -1208,17 +1217,37 @@ class SnowflakeBillingEvent(BaseModel):
1208
1217
  raise ValueError("start_timestamp must be timezone aware")
1209
1218
  return values
1210
1219
 
1211
- class BillingEventRequest(BaseModel):
1220
+ class DailyBillingEventRequest(BaseModel):
1212
1221
  """
1213
1222
  Represents a request to provide billing events for that day.
1223
+ These will occur at midnight, and cover the previous 24 hours.
1224
+ Provides enough information for the plugin to create billing events for the day.
1225
+ """
1226
+
1227
+ billing_schedule: Literal["DAILY"] = "DAILY"
1228
+ billable_connections_inbound: int = 0
1229
+ billable_connections_outbound: int = 0
1230
+ # below is deprecated
1231
+ has_active_inbound: bool = False
1232
+ has_active_outbound: bool = False
1233
+
1234
+ class MonthlyBillingEventRequest(BaseModel):
1235
+ """
1236
+ Represents a request to provide billing events for that month.
1237
+ These will occur at midnight on the first of each month, and cover the whole previous month.
1238
+ Currently, these exist to provide a way to bill for the number of active ngrok connections
1239
+ and associated data overages.
1214
1240
  """
1215
1241
 
1216
- billing_schedule: Literal["DAILY"]
1217
- has_active_inbound: bool
1218
- has_active_outbound: bool
1242
+ billing_schedule: Literal["MONTHLY"] = "MONTHLY"
1243
+ distinct_active_ngrok_connections: int = 0
1244
+ ngrok_data_usage_bytes: int = 0
1245
+ # below is deprecated
1246
+ has_active_inbound: bool = False
1247
+ has_active_outbound: bool = False
1219
1248
 
1220
1249
 
1221
- # BillingEventRequest = Annotated[Union[DailyBillingEventRequest,...],Field(discriminator='billing_schedule')]
1250
+ BillingEventRequest = Annotated[Union[DailyBillingEventRequest,MonthlyBillingEventRequest],Field(discriminator='billing_schedule')]
1222
1251
 
1223
1252
 
1224
1253
  class OmnataPlugin(ABC):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: omnata-plugin-runtime
3
- Version: 0.3.9a20
3
+ Version: 0.3.9a23
4
4
  Summary: Classes and common runtime components for building and running Omnata Plugins
5
5
  Author: James Weakley
6
6
  Author-email: james.weakley@omnata.com
@@ -3,10 +3,10 @@ omnata_plugin_runtime/api.py,sha256=_N5ok5LN7GDO4J9n3yduXp3tpjmhpySY__U2baiygrs,
3
3
  omnata_plugin_runtime/configuration.py,sha256=at29ExowF_T4_2U9gY0BF4IVdwC-vDytmNRHL7UCWh8,34742
4
4
  omnata_plugin_runtime/forms.py,sha256=30CJB24TqfLYNnkplZdUbeqA-P9rUIBujVKXw_S-wKY,18371
5
5
  omnata_plugin_runtime/logging.py,sha256=bn7eKoNWvtuyTk7RTwBS9UARMtqkiICtgMtzq3KA2V0,3272
6
- omnata_plugin_runtime/omnata_plugin.py,sha256=oOB_PUU0qCUzJDEyKnlKo9_j-GVPugIEuf-0EthBJLU,88491
6
+ omnata_plugin_runtime/omnata_plugin.py,sha256=oSDBMEL8gJK_MA6eiawG3ELuT_eka-YM-0AmIHHABNE,89659
7
7
  omnata_plugin_runtime/plugin_entrypoints.py,sha256=T6cGdEacgGxoMT9xWJ2DayeDanu8cO58kicdqKsp4Uw,27604
8
8
  omnata_plugin_runtime/rate_limiting.py,sha256=se6MftQI5NrVHaLb1hByPCgAESPQhkAgIG7KIU1clDU,16562
9
- omnata_plugin_runtime-0.3.9a20.dist-info/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
10
- omnata_plugin_runtime-0.3.9a20.dist-info/METADATA,sha256=esWe3xRYAzfhTMa27Qp_uYCz7kpU2AVaUb32NjuemfM,1603
11
- omnata_plugin_runtime-0.3.9a20.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
12
- omnata_plugin_runtime-0.3.9a20.dist-info/RECORD,,
9
+ omnata_plugin_runtime-0.3.9a23.dist-info/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
10
+ omnata_plugin_runtime-0.3.9a23.dist-info/METADATA,sha256=5zxT-AufDn6CQdTZjq_FbgL_Px6DojX0RS-AfbtyBM4,1603
11
+ omnata_plugin_runtime-0.3.9a23.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
12
+ omnata_plugin_runtime-0.3.9a23.dist-info/RECORD,,