omnata-plugin-runtime 0.1.82__py3-none-any.whl → 0.1.84__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.
@@ -1058,8 +1058,8 @@ class SnowflakeBillingEvent(BaseModel):
1058
1058
  """
1059
1059
 
1060
1060
  billing_class: str
1061
- timestamp: datetime.datetime
1062
1061
  base_charge: Decimal
1062
+ timestamp: datetime.datetime = datetime.datetime.now()
1063
1063
  sub_class: Optional[str] = None
1064
1064
  start_timestamp: Optional[datetime.datetime] = None
1065
1065
  objects: List[str] = []
@@ -324,19 +324,17 @@ class PluginEntrypoint:
324
324
  time.sleep(1)
325
325
  else:
326
326
  first_time = False
327
- current_time = int(time.time() * 1000)
328
- billing_event_time = int(
329
- billing_event.start_timestamp.replace(
330
- tzinfo=datetime.timezone.utc
331
- ).timestamp()
332
- * 1000
333
- )
327
+ timestamp_value = int(billing_event.timestamp.timestamp()*1000)
328
+ if billing_event.start_timestamp is None:
329
+ start_timestamp_value=timestamp_value
330
+ else:
331
+ start_timestamp_value=int(billing_event.start_timestamp.timestamp()*1000)
334
332
  try:
335
333
  event_query = f"""call SYSTEM$CREATE_BILLING_EVENT(
336
334
  $${billing_event.billing_class}$$,
337
- $${billing_event.billing_subclass}$$,
338
- {billing_event_time},
339
- {current_time},
335
+ $${billing_event.sub_class}$$,
336
+ {start_timestamp_value},
337
+ {timestamp_value},
340
338
  {str(billing_event.base_charge)},
341
339
  $${json.dumps(billing_event.objects)}$$,
342
340
  $${json.dumps(billing_event.additional_info)}$$)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: omnata-plugin-runtime
3
- Version: 0.1.82
3
+ Version: 0.1.84
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=vCDTCxPZ5rIhi8aSM6Z0TXWHtGpbCoNvCnM3mKa-47Q,
3
3
  omnata_plugin_runtime/configuration.py,sha256=7P1g8ryOqiXULhKnosAp_uS-h4bZP7i0VZOQ3Izmsac,29513
4
4
  omnata_plugin_runtime/forms.py,sha256=AEj74Wko89zBSgucVfPRctU-MI-AuYsIOEBDPhDi6Hc,15050
5
5
  omnata_plugin_runtime/logging.py,sha256=ne1sLh5cBkjdRS54B30PGc5frABgjy0sF1_2RMcJ_Tk,3012
6
- omnata_plugin_runtime/omnata_plugin.py,sha256=pU82FUI1BOpO3SMe4sh-p0whG0VP--01Vn3MdY5cTxg,74261
7
- omnata_plugin_runtime/plugin_entrypoints.py,sha256=kD83aN3bMD2t-JMQGCQhT1gadHMhwPUjvKZ_rx-m5mM,21586
6
+ omnata_plugin_runtime/omnata_plugin.py,sha256=x4Vvd1a8FNNiQNiURFuhp8s7FIuJgX03xR5d_iNTxK0,74287
7
+ omnata_plugin_runtime/plugin_entrypoints.py,sha256=iN-KnGyEWcs-rJz6NGPf84k02eDG-narH1sg1gNU_4Y,21617
8
8
  omnata_plugin_runtime/rate_limiting.py,sha256=OnFnCdMenpMpAZYumpe6mypRnMmDl1Q02vzlgmQgiw0,10733
9
- omnata_plugin_runtime-0.1.82.dist-info/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
10
- omnata_plugin_runtime-0.1.82.dist-info/METADATA,sha256=P6X8AOARAtkgvjGUcxkLn1aTjSdndvf95VSr7lzq4NM,987
11
- omnata_plugin_runtime-0.1.82.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
12
- omnata_plugin_runtime-0.1.82.dist-info/RECORD,,
9
+ omnata_plugin_runtime-0.1.84.dist-info/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
10
+ omnata_plugin_runtime-0.1.84.dist-info/METADATA,sha256=rhW4QZsK44Lrf7_vxJUGF5oM29wrmvLp7mfbzSFnBis,987
11
+ omnata_plugin_runtime-0.1.84.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
12
+ omnata_plugin_runtime-0.1.84.dist-info/RECORD,,