omnata-plugin-runtime 0.1.87__py3-none-any.whl → 0.1.89__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.
@@ -565,14 +565,15 @@ class SyncConfigurationParameters(ConnectionConfigurationParameters):
565
565
  self, parameter_name: str, default_value: Optional[str] = None
566
566
  ) -> StoredConfigurationValue:
567
567
  """
568
- Retrieves a connection parameter, which was collected during connection configuration.
569
- What you can expect to retrieve is based on the form definition returned by your connection_form function (form fields returned with secret=False).
568
+ Retrieves a parameter from the current form. The "current form" refers to a temporary form which is not part of the final sync configuration,
569
+ such as a new option creator for a data source.
570
+ What you can expect to retrieve is based on the form definition returned by your NewOptionCreator's creation form function.
570
571
 
571
572
  :param str parameter_name: The name of the parameter
572
573
  :param str default_value: A default value to return if the parameter does not exist
573
574
  :return: the configuration value, which contains a string property named "value", and a metadata dict
574
575
  :rtype: StoredConfigurationValue
575
- :raises ValueError: if a connection parameter by that name does not exist
576
+ :raises ValueError: if a form parameter by that name does not exist, and no default was provided
576
577
  """
577
578
  if parameter_name not in self.current_form_parameters.keys():
578
579
  if default_value is not None:
@@ -584,7 +585,8 @@ class SyncConfigurationParameters(ConnectionConfigurationParameters):
584
585
 
585
586
  def condense_current_form_parameters(self, exclude_fields: List[str]) -> dict:
586
587
  """
587
- Takes a dictionary representing a completed form, and condenses it into a simple dictionary containing just the values of each field
588
+ Takes a dictionary representing a completed form, and condenses it into a simple dictionary containing just the values of each field.
589
+ This is useful for building a metadata object that typically accompanies a value in a StoredConfigurationValue.
588
590
  """
589
591
  return_dict = {}
590
592
  for dict_key in self.current_form_parameters.keys():
@@ -19,6 +19,7 @@ from .configuration import (
19
19
  StreamConfiguration,
20
20
  SyncConfigurationParameters,
21
21
  InboundSyncConfigurationParameters,
22
+ StoredConfigurationValue,
22
23
  )
23
24
 
24
25
 
@@ -325,14 +326,20 @@ class ConfigurationFormBase(BaseModel, ABC):
325
326
  class NewOptionCreator(SubscriptableBaseModel):
326
327
  """
327
328
  Allows for options to be added to a datasource by the user.
328
- It does this by presenting the user with a form, then building a FormOption from the provided values.
329
+ It does this by presenting the user with a form, then building a StoredConfigurationValue from the provided values.
330
+ Since this StoredConfigurationValue won't be present in the data source (at least not initially), there is
331
+ also a function (construct_form_option) to convert the StoredConfigurationValue into a FormOption which can be added to the data source.
332
+ This means that all the presentation options (e.g. required, unique) must be derivable from the metadata in StoredConfigurationValue.
329
333
  """
330
334
 
331
335
  creation_form_function: Union[
332
336
  Callable[[SyncConfigurationParameters], ConfigurationFormBase], str
333
337
  ]
334
338
  creation_complete_function: Union[
335
- Callable[[SyncConfigurationParameters], FormOption], str
339
+ Callable[[SyncConfigurationParameters], StoredConfigurationValue], str
340
+ ]
341
+ construct_form_option: Union[
342
+ Callable[[StoredConfigurationValue], FormOption], str
336
343
  ]
337
344
  allow_create: bool = True
338
345
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: omnata-plugin-runtime
3
- Version: 0.1.87
3
+ Version: 0.1.89
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,12 +1,12 @@
1
1
  omnata_plugin_runtime/__init__.py,sha256=w63LVME5nY-hQ4BBzfacy9kvTunwqHGs8iiSPGAX2ns,1214
2
2
  omnata_plugin_runtime/api.py,sha256=vCDTCxPZ5rIhi8aSM6Z0TXWHtGpbCoNvCnM3mKa-47Q,5591
3
- omnata_plugin_runtime/configuration.py,sha256=7P1g8ryOqiXULhKnosAp_uS-h4bZP7i0VZOQ3Izmsac,29513
4
- omnata_plugin_runtime/forms.py,sha256=AEj74Wko89zBSgucVfPRctU-MI-AuYsIOEBDPhDi6Hc,15050
3
+ omnata_plugin_runtime/configuration.py,sha256=xtPp0ET1Gdgk4zjklWwXLNuczVZ_rMhaKDS5c9ZCwVU,29744
4
+ omnata_plugin_runtime/forms.py,sha256=85T2LVFHg3w2PPNi9ug9mOd3blkYB3ajhZhXaBHEXp8,15600
5
5
  omnata_plugin_runtime/logging.py,sha256=ne1sLh5cBkjdRS54B30PGc5frABgjy0sF1_2RMcJ_Tk,3012
6
6
  omnata_plugin_runtime/omnata_plugin.py,sha256=x4Vvd1a8FNNiQNiURFuhp8s7FIuJgX03xR5d_iNTxK0,74287
7
7
  omnata_plugin_runtime/plugin_entrypoints.py,sha256=m1wrGf_uYxJNuv2N5r5QoyPWtor98bYGIBunocHWoIc,21652
8
8
  omnata_plugin_runtime/rate_limiting.py,sha256=OnFnCdMenpMpAZYumpe6mypRnMmDl1Q02vzlgmQgiw0,10733
9
- omnata_plugin_runtime-0.1.87.dist-info/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
10
- omnata_plugin_runtime-0.1.87.dist-info/METADATA,sha256=XF7SxK_67K6zWREm91HMdOW9lAg5pYnph-YoMCVfvnY,1086
11
- omnata_plugin_runtime-0.1.87.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
12
- omnata_plugin_runtime-0.1.87.dist-info/RECORD,,
9
+ omnata_plugin_runtime-0.1.89.dist-info/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
10
+ omnata_plugin_runtime-0.1.89.dist-info/METADATA,sha256=IP9fv2rD02MuH4d-kG7zZ0MmfIpUJ7UwM8nekqul4-I,1086
11
+ omnata_plugin_runtime-0.1.89.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
12
+ omnata_plugin_runtime-0.1.89.dist-info/RECORD,,