omnata-plugin-runtime 0.9.1a212__py3-none-any.whl → 0.9.2a213__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,10 +7,11 @@ import json
7
7
  import sys
8
8
  import logging
9
9
  from typing import Any, List, Dict, Literal, Union, Optional
10
+ from typing_extensions import Self
10
11
  from enum import Enum
11
12
 
12
13
  from abc import ABC
13
- from pydantic import BaseModel, Field, PrivateAttr, SerializationInfo, TypeAdapter, field_validator, model_serializer, validator # pylint: disable=no-name-in-module
14
+ from pydantic import BaseModel, Field, PrivateAttr, SerializationInfo, TypeAdapter, field_validator, model_serializer, model_validator # pylint: disable=no-name-in-module
14
15
  from .logging import logger, tracer
15
16
 
16
17
  if tuple(sys.version_info[:2]) >= (3, 9):
@@ -599,22 +600,20 @@ class ConnectionConfigurationParameters(SubscriptableBaseModel):
599
600
  default=None
600
601
  )
601
602
 
602
- @field_validator('ngrok_tunnel_settings',mode='before')
603
- @classmethod
604
- def validate_ngrok_tunnel_settings(cls, values: Optional[dict[str, Any]]) -> Optional[NgrokTunnelSettings]:
605
- if "connection_secrets" in values:
606
- connection_secrets:Dict[str, StoredConfigurationValue] = values["connection_secrets"]
607
- if "ngrok_client_certificate" in connection_secrets and \
608
- "ngrok_client_key" in connection_secrets and \
609
- "ngrok_endpoint_host" in connection_secrets and \
610
- "ngrok_endpoint_port" in connection_secrets:
611
- return NgrokTunnelSettings(
612
- endpoint_host=connection_secrets["ngrok_endpoint_host"].value,
613
- endpoint_port=connection_secrets["ngrok_endpoint_port"].value,
614
- client_certificate=connection_secrets["ngrok_client_certificate"].value,
615
- client_key=connection_secrets["ngrok_client_key"].value
603
+ @model_validator(mode='after')
604
+ def validate_ngrok_tunnel_settings(self) -> Self:
605
+ if self.connection_secrets:
606
+ if "ngrok_client_certificate" in self.connection_secrets and \
607
+ "ngrok_client_key" in self.connection_secrets and \
608
+ "ngrok_endpoint_host" in self.connection_secrets and \
609
+ "ngrok_endpoint_port" in self.connection_secrets:
610
+ self.ngrok_tunnel_settings = NgrokTunnelSettings(
611
+ endpoint_host=self.connection_secrets["ngrok_endpoint_host"].value,
612
+ endpoint_port=int(self.connection_secrets["ngrok_endpoint_port"].value),
613
+ client_certificate=self.connection_secrets["ngrok_client_certificate"].value,
614
+ client_key=self.connection_secrets["ngrok_client_key"].value
616
615
  )
617
- return None
616
+ return self
618
617
 
619
618
  def get_connection_parameter(self, parameter_name: str) -> StoredConfigurationValue:
620
619
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: omnata-plugin-runtime
3
- Version: 0.9.1a212
3
+ Version: 0.9.2a213
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
@@ -1,13 +1,13 @@
1
1
  omnata_plugin_runtime/__init__.py,sha256=MS9d1whnfT_B3-ThqZ7l63QeC_8OEKTuaYV5wTwRpBA,1576
2
2
  omnata_plugin_runtime/api.py,sha256=baGraSMiD4Yvi3ZWrEv_TKh8Ktd1U8riBdOpe9j0Puw,8202
3
- omnata_plugin_runtime/configuration.py,sha256=hHWaK72q45cCQ2R7x9vX2tGifvUDabMrVXBZF4XX0TY,41286
3
+ omnata_plugin_runtime/configuration.py,sha256=H1snDDtS4DF2AILynob878ZKcronnZl5Qig6dE9KDoc,41189
4
4
  omnata_plugin_runtime/forms.py,sha256=9YHJ_T17lT-rwyDaUg_0yj_YMPda4DRCw_wrvf8hE0E,19964
5
5
  omnata_plugin_runtime/json_schema.py,sha256=Q5lGoRRoM_RKd4LzuH2khLTweqFoskgAr1oLGHczR0Y,25807
6
6
  omnata_plugin_runtime/logging.py,sha256=WBuZt8lF9E5oFWM4KYQbE8dDJ_HctJ1pN3BHwU6rcd0,4461
7
7
  omnata_plugin_runtime/omnata_plugin.py,sha256=IDj8EaWZuEKaTPrWm3wzHvdmW4l2WibCZEj9AnyTHLU,131622
8
8
  omnata_plugin_runtime/plugin_entrypoints.py,sha256=iqGl8_nEEnPGKg3Aem4YLSQ6d5xS3ju5gq8MJbx6sCA,31968
9
9
  omnata_plugin_runtime/rate_limiting.py,sha256=qpr5esU4Ks8hMzuMpSR3gLFdor2ZUXYWCjmsQH_K6lQ,25882
10
- omnata_plugin_runtime-0.9.1a212.dist-info/LICENSE,sha256=rGaMQG3R3F5-JGDp_-rlMKpDIkg5n0SI4kctTk8eZSI,56
11
- omnata_plugin_runtime-0.9.1a212.dist-info/METADATA,sha256=VP6QW_sICEcvGfUVtYIbZMu6JjexYIpcbAR5E3_XOXI,2158
12
- omnata_plugin_runtime-0.9.1a212.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
13
- omnata_plugin_runtime-0.9.1a212.dist-info/RECORD,,
10
+ omnata_plugin_runtime-0.9.2a213.dist-info/LICENSE,sha256=rGaMQG3R3F5-JGDp_-rlMKpDIkg5n0SI4kctTk8eZSI,56
11
+ omnata_plugin_runtime-0.9.2a213.dist-info/METADATA,sha256=G2yIggwcqnUczQVR8AJpXT_aqKaNDN3XMJalgRYOtjQ,2158
12
+ omnata_plugin_runtime-0.9.2a213.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
13
+ omnata_plugin_runtime-0.9.2a213.dist-info/RECORD,,