omnata-plugin-runtime 0.9.1a212__tar.gz → 0.9.2a213__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -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,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "omnata-plugin-runtime"
3
- version = "0.9.1-a212"
3
+ version = "0.9.2-a213"
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"
@@ -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
  """