pyegeria 0.8.4.49__py3-none-any.whl → 1.5.1__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.
@@ -9,7 +9,7 @@ import asyncio
9
9
 
10
10
  # import json
11
11
  from pyegeria._client import Client
12
- from pyegeria._globals import enable_ssl_check, max_paging_size
12
+ from pyegeria._globals import max_paging_size
13
13
 
14
14
 
15
15
  class ValidMetadataManager(Client):
@@ -67,6 +67,17 @@ class ValidMetadataManager(Client):
67
67
 
68
68
  Returns
69
69
  -------
70
+ No value is returned.
71
+
72
+ Raises
73
+ ------
74
+ InvalidParameterException
75
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
76
+ PropertyServerException
77
+ Raised by the server when an issue arises in processing a valid request
78
+ NotAuthorizedException
79
+ The principle specified by the user_id does not have authorization for the requested action
80
+
70
81
 
71
82
  Notes
72
83
  -----
@@ -78,7 +89,9 @@ class ValidMetadataManager(Client):
78
89
  "preferredValue": "",
79
90
  "dataType": "",
80
91
  "isCaseSensitive": false,
81
- "isDeprecated" : false
92
+ "isDeprecated" : false,
93
+ "effectiveFrom" : "2024-09-30T20:00:00.000Z",
94
+ "effectiveTo" : "2025-09-30T20:00:00.000Z",
82
95
  }
83
96
  """
84
97
 
@@ -87,63 +100,895 @@ class ValidMetadataManager(Client):
87
100
  f"typeName={type_name}"
88
101
  )
89
102
 
90
- await self._async_make_request("POST", url, body)
91
- return
103
+ await self._async_make_request("POST", url, body)
104
+ return
105
+
106
+ def setup_valid_metadata_value(
107
+ self, property_name: str, type_name: str, body: dict
108
+ ):
109
+ """Create or update the valid value for a particular open metadata property name. If the typeName is null,
110
+ this valid value applies to properties of this name from all types. The valid value is stored in the
111
+ preferredValue property. If a valid value is already set up for this property (with overlapping effective dates)
112
+ then the valid value is updated.
113
+
114
+ Parameters
115
+ ----------
116
+ property_name : str
117
+ The name of the property for which the valid metadata value is being set up.
118
+ type_name : str
119
+ The name of the type for the valid metadata value.
120
+ body : dict
121
+ The body of the request containing the details of the valid metadata value.
122
+
123
+
124
+ Returns
125
+ -------
126
+ None - this method does not return a value.
127
+
128
+ Raises
129
+ ------
130
+ InvalidParameterException
131
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
132
+ PropertyServerException
133
+ Raised by the server when an issue arises in processing a valid request
134
+ NotAuthorizedException
135
+ The principle specified by the user_id does not have authorization for the requested action
136
+
137
+ Notes
138
+ -----
139
+
140
+ Payload structure similar to:
141
+ {
142
+ "displayName": "",
143
+ "description": "",
144
+ "preferredValue": "",
145
+ "dataType": "",
146
+ "isCaseSensitive": false,
147
+ "isDeprecated" : false,
148
+ "additionalProperties": {
149
+ "colour": "purple"
150
+ }
151
+ }
152
+ """
153
+ loop = asyncio.get_event_loop()
154
+ loop.run_until_complete(
155
+ self._async_setup_valid_metadata_value(property_name, type_name, body)
156
+ )
157
+ return
158
+
159
+ async def _async_setup_valid_metadata_map_name(
160
+ self, property_name: str, type_name: str, body: dict
161
+ ):
162
+ """Create or update the valid value for a name that can be stored in a particular open metadata property name.
163
+ This property is of type map from name to string. The mapName is stored in the preferredValue property of
164
+ validMetadataValue. If the typeName is null, this valid value applies to properties of this name from any
165
+ open metadata type. If a valid value is already set up for this property (with overlapping effective dates)
166
+ then the valid value is updated. Async Version.
167
+
168
+ Parameters
169
+ ----------
170
+ property_name : str
171
+ The name of the property to setup metadata map.
172
+ type_name : str
173
+ The type name of the property.
174
+ body : dict
175
+ The metadata map setup data.
176
+
177
+
178
+ Returns
179
+ -------
180
+ None
181
+ This method does not return any value.
182
+
183
+ Raises
184
+ ------
185
+ InvalidParameterException
186
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
187
+ PropertyServerException
188
+ Raised by the server when an issue arises in processing a valid request
189
+ NotAuthorizedException
190
+ The principle specified by the user_id does not have authorization for the requested action
191
+
192
+
193
+ Notes
194
+ -----
195
+
196
+ Body strycture similar to:
197
+
198
+ {
199
+ "displayName": "",
200
+ "description": "",
201
+ "preferredValue": "put mapName value here",
202
+ "dataType": "",
203
+ "isCaseSensitive": false,
204
+ "isDeprecated" : false,
205
+ "effectiveFrom" : "2024-09-30T20:00:00.000Z",
206
+ "effectiveTo" : "2025-09-30T20:00:00.000Z"
207
+ }
208
+
209
+ """
210
+
211
+ url = (
212
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/valid-metadata/setup-map-name/{property_name}?"
213
+ f"typeName={type_name}"
214
+ )
215
+
216
+ await self._async_make_request("POST", url, body)
217
+ return
218
+
219
+ def setup_valid_metadata_map_name(
220
+ self, property_name: str, type_name: str, body: dict
221
+ ):
222
+ """Create or update the valid value for a name that can be stored in a particular open metadata property name.
223
+ This property is of type map from name to string. The mapName is stored in the preferredValue property of
224
+ validMetadataValue. If the typeName is null, this valid value applies to properties of this name from any
225
+ open metadata type. If a valid value is already set up for this property (with overlapping effective dates)
226
+ then the valid value is updated.
227
+
228
+ Parameters
229
+ ----------
230
+ property_name : str
231
+ The name of the property to setup metadata map.
232
+ type_name : str
233
+ The type name of the property.
234
+ body : dict
235
+ The metadata map setup data.
236
+
237
+
238
+ Returns
239
+ -------
240
+ None
241
+ This method does not return any value.
242
+
243
+ Raises
244
+ ------
245
+ InvalidParameterException
246
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
247
+ PropertyServerException
248
+ Raised by the server when an issue arises in processing a valid request
249
+ NotAuthorizedException
250
+ The principle specified by the user_id does not have authorization for the requested action
251
+
252
+
253
+ Notes
254
+ -----
255
+
256
+ Body strycture similar to:
257
+
258
+ {
259
+ "displayName": "",
260
+ "description": "",
261
+ "preferredValue": "put mapName value here",
262
+ "dataType": "",
263
+ "isCaseSensitive": false,
264
+ "isDeprecated" : false
265
+ }
266
+
267
+ """
268
+
269
+ loop = asyncio.get_event_loop()
270
+ loop.run_until_complete(
271
+ self._async_setup_valid_metadata_map_name(property_name, type_name, body)
272
+ )
273
+ return
274
+
275
+ async def _async_setup_valid_metadata_map_value(
276
+ self, property_name: str, type_name: str, map_name: str, body: dict
277
+ ) -> None:
278
+ """Create or update the valid value for a name that can be stored in a particular open metadata property name.
279
+ This property is of type map from name to string.
280
+ The valid value is stored in the preferredValue property of validMetadataValue.
281
+ If the typeName is null, this valid value applies to properties of this name from any open metadata type.
282
+ If a valid value is already set up for this property (with overlapping effective dates) then the valid value
283
+ is updated. Async version.
284
+
285
+ Parameters
286
+ ----------
287
+ property_name : str
288
+ The name of the property to setup metadata map.
289
+ type_name : str
290
+ The type name of the property.
291
+ map_name: str
292
+ The name of a map we associate a value with.
293
+ body : dict
294
+ The metadata map setup data.
295
+
296
+ Returns
297
+ -------
298
+ None
299
+ This method does not return any value.
300
+
301
+ Raises
302
+ ------
303
+ InvalidParameterException
304
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
305
+ PropertyServerException
306
+ Raised by the server when an issue arises in processing a valid request
307
+ NotAuthorizedException
308
+ The principle specified by the user_id does not have authorization for the requested action
309
+
310
+
311
+ Notes
312
+ -----
313
+
314
+ Body strycture similar to:
315
+
316
+ {
317
+ "displayName": "",
318
+ "description": "",
319
+ "preferredValue": "put mapName value here",
320
+ "dataType": "",
321
+ "isCaseSensitive": false,
322
+ "effectiveFrom" : "2024-09-30T20:00:00.000Z",
323
+ "effectiveTo" : "2025-09-30T20:00:00.000Z"
324
+ }
325
+ """
326
+ url = (
327
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/valid-metadata/setup-map-value/"
328
+ f"{property_name}/{map_name}?typeName={type_name}"
329
+ )
330
+
331
+ await self._async_make_request("POST", url, body)
332
+ return
333
+
334
+ def setup_valid_metadata_map_value(
335
+ self, property_name: str, type_name: str, map_name: str, body: dict
336
+ ) -> None:
337
+ """Create or update the valid value for a name that can be stored in a particular open metadata property name.
338
+ This property is of type map from name to string.
339
+ The valid value is stored in the preferredValue property of validMetadataValue.
340
+ If the typeName is null, this valid value applies to properties of this name from any open metadata type.
341
+ If a valid value is already set up for this property (with overlapping effective dates) then the valid value
342
+ is updated.
343
+
344
+ Parameters
345
+ ----------
346
+ property_name : str
347
+ The name of the property to setup metadata map.
348
+ type_name : str
349
+ The type name of the property.
350
+ map_name: str
351
+ The name of a map we associate a value with.
352
+ body : dict
353
+ The metadata map setup data.
354
+
355
+
356
+ Returns
357
+ -------
358
+ None
359
+ This method does not return a value.
360
+
361
+ Raises
362
+ ------
363
+ InvalidParameterException
364
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
365
+ PropertyServerException
366
+ Raised by the server when an issue arises in processing a valid request
367
+ NotAuthorizedException
368
+ The principle specified by the user_id does not have authorization for the requested action
369
+
370
+
371
+ Notes
372
+ -----
373
+
374
+ Body structure similar to:
375
+
376
+ {
377
+ "displayName": "",
378
+ "description": "",
379
+ "preferredValue": "put mapName value here",
380
+ "dataType": "",
381
+ "isCaseSensitive": false,
382
+ }
383
+ """
384
+ loop = asyncio.get_event_loop()
385
+ loop.run_until_complete(
386
+ self._async_setup_valid_metadata_map_value(
387
+ property_name, type_name, map_name, body
388
+ )
389
+ )
390
+ return
391
+
392
+ async def _async_clear_valid_metadata_value(
393
+ self, property_name: str, type_name: str, preferred_value: str
394
+ ) -> None:
395
+ """Remove a valid value for a property. Async version.
396
+
397
+ Parameters
398
+ ----------
399
+ property_name : str
400
+ The name of the property to setup metadata map.
401
+ type_name : str
402
+ The type name of the property.
403
+ preferred_value: str
404
+ The reference valye to remove.
405
+
406
+ Returns
407
+ -------
408
+ None - This method does not return a value.
409
+
410
+ Raises
411
+ ------
412
+ InvalidParameterException
413
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
414
+ PropertyServerException
415
+ Raised by the server when an issue arises in processing a valid request
416
+ NotAuthorizedException
417
+ The principle specified by the user_id does not have authorization for the requested action
418
+
419
+
420
+ """
421
+ url = (
422
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/valid-metadata/clear-value/"
423
+ f"{property_name}?typeName={type_name}&preferredValue={preferred_value}"
424
+ )
425
+
426
+ await self._async_make_request("POST", url)
427
+ return
428
+
429
+ def clear_valid_metadata_value(
430
+ self, property_name: str, type_name: str, preferred_value: str
431
+ ) -> None:
432
+ """Remove a valid value for a property.
433
+
434
+ Parameters
435
+ ----------
436
+ property_name : str
437
+ The name of the property to setup metadata map.
438
+ type_name : str
439
+ The type name of the property.
440
+ preferred_value: str
441
+ The reference valye to remove.
442
+
443
+ Returns
444
+ -------
445
+ None - This method does not return a value.
446
+
447
+ Raises
448
+ ------
449
+ InvalidParameterException
450
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
451
+ PropertyServerException
452
+ Raised by the server when an issue arises in processing a valid request
453
+ NotAuthorizedException
454
+ The principle specified by the user_id does not have authorization for the requested action
455
+
456
+
457
+ """
458
+ loop = asyncio.get_event_loop()
459
+ loop.run_until_complete(
460
+ self._async_clear_valid_metadata_value(
461
+ property_name, type_name, preferred_value
462
+ )
463
+ )
464
+ return
465
+
466
+ async def _async_clear_valid_metadata_map_name(
467
+ self,
468
+ property_name: str,
469
+ type_name: str,
470
+ map_name: str,
471
+ ):
472
+ """Remove a valid map name value for a property. The match is done on MapName name. Async version.
473
+
474
+ Parameters
475
+ ----------
476
+ property_name : str
477
+ The name of the property to setup metadata map.
478
+ type_name : str
479
+ The type name of the property.
480
+ map_name: str
481
+ The name of a map we associate a value with.
482
+
483
+ Returns
484
+ -------
485
+ None - This method does not return a value.
486
+
487
+ Raises
488
+ ------
489
+ InvalidParameterException
490
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
491
+ PropertyServerException
492
+ Raised by the server when an issue arises in processing a valid request
493
+ NotAuthorizedException
494
+ The principle specified by the user_id does not have authorization for the requested action
495
+
496
+ """
497
+
498
+ url = (
499
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/valid-metadata/clear-map-name/"
500
+ f"{property_name}?typeName={type_name}&mapName={map_name}"
501
+ )
502
+
503
+ await self._async_make_request("POST", url)
504
+ return
505
+
506
+ def clear_valid_metadata_map_name(
507
+ self,
508
+ property_name: str,
509
+ type_name: str,
510
+ map_name: str,
511
+ ):
512
+ """Remove a valid map name value for a property. The match is done on MapName name.
513
+
514
+ Parameters
515
+ ----------
516
+ property_name : str
517
+ The name of the property to setup metadata map.
518
+ type_name : str
519
+ The type name of the property.
520
+ map_name: str
521
+ The name of a map we associate a value with.
522
+
523
+ Returns
524
+ -------
525
+ None - This method does not return a value.
526
+
527
+ Raises
528
+ ------
529
+ InvalidParameterException
530
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
531
+ PropertyServerException
532
+ Raised by the server when an issue arises in processing a valid request
533
+ NotAuthorizedException
534
+ The principle specified by the user_id does not have authorization for the requested action
535
+
536
+ """
537
+
538
+ loop = asyncio.get_event_loop()
539
+ loop.run_until_complete(
540
+ self._async_clear_valid_metadata_map_name(
541
+ property_name, type_name, map_name
542
+ )
543
+ )
544
+ return
545
+
546
+ async def _async_clear_valid_metadata_map_value(
547
+ self, property_name: str, type_name: str, preferred_value: str
548
+ ):
549
+ """Remove a valid map name value for a property. The match is done on preferred name. Async version.
550
+
551
+ Parameters
552
+ ----------
553
+ property_name : str
554
+ The name of the property to setup metadata map.
555
+ type_name : str
556
+ The type name of the property.
557
+ preferred_value: str
558
+ The value to remove.
559
+
560
+ Returns
561
+ -------
562
+ None - This method does not return a value.
563
+
564
+ Raises
565
+ ------
566
+ InvalidParameterException
567
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
568
+ PropertyServerException
569
+ Raised by the server when an issue arises in processing a valid request
570
+ NotAuthorizedException
571
+ The principle specified by the user_id does not have authorization for the requested action
572
+
573
+ """
574
+
575
+ url = (
576
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/valid-metadata/clear-map-value/"
577
+ f"{property_name}?typeName={type_name}&preferredValue={preferred_value}"
578
+ )
579
+
580
+ await self._async_make_request("POST", url)
581
+ return
582
+
583
+ def clear_valid_metadata_map_value(
584
+ self, property_name: str, type_name: str, preferred_value: str
585
+ ):
586
+ """Remove a valid map name value for a property. The match is done on preferred name.
587
+
588
+ Parameters
589
+ ----------
590
+ property_name : str
591
+ The name of the property to setup metadata map.
592
+ type_name : str
593
+ The type name of the property.
594
+ preferred_value: str
595
+ The value to remove.
596
+
597
+ Returns
598
+ -------
599
+ None - This method does not return a value.
600
+
601
+ Raises
602
+ ------
603
+ InvalidParameterException
604
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
605
+ PropertyServerException
606
+ Raised by the server when an issue arises in processing a valid request
607
+ NotAuthorizedException
608
+ The principle specified by the user_id does not have authorization for the requested action
609
+
610
+ """
611
+
612
+ loop = asyncio.get_event_loop()
613
+ loop.run_until_complete(
614
+ self._async_clear_valid_metadata_map_value(
615
+ property_name, type_name, preferred_value
616
+ )
617
+ )
618
+ return
619
+
620
+ async def _async_validate_metadata_value(
621
+ self, property_name: str, type_name: str, actual_value: str
622
+ ) -> bool | str:
623
+ """Validate whether the value found in an open metadata property is valid. Async version.
624
+
625
+ Parameters
626
+ ----------
627
+ property_name : str
628
+ The name of the property to setup metadata map.
629
+ type_name : str
630
+ The type name of the property.
631
+ actual_value: str
632
+ The value to validate.
633
+
634
+ Returns
635
+ -------
636
+ Bool - True, if validated.
637
+
638
+ Raises
639
+ ------
640
+ InvalidParameterException
641
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
642
+ PropertyServerException
643
+ Raised by the server when an issue arises in processing a valid request
644
+ NotAuthorizedException
645
+ The principle specified by the user_id does not have authorization for the requested action
646
+
647
+ """
648
+
649
+ url = (
650
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/valid-metadata/validate-value/"
651
+ f"{property_name}?typeName={type_name}&actualValue={actual_value}"
652
+ )
653
+
654
+ response = await self._async_make_request("GET", url)
655
+ return response.json().get("flag", "No flag found")
656
+
657
+ def validate_metadata_value(
658
+ self, property_name: str, type_name: str, actual_value: str
659
+ ) -> bool | str:
660
+ """Validate whether the value found in an open metadata property is valid.
661
+
662
+ Parameters
663
+ ----------
664
+ property_name : str
665
+ The name of the property to setup metadata map.
666
+ type_name : str
667
+ The type name of the property.
668
+ actual_value: str
669
+ The value to validate.
670
+
671
+ Returns
672
+ -------
673
+ Bool - True, if validated.
674
+
675
+ Raises
676
+ ------
677
+ InvalidParameterException
678
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
679
+ PropertyServerException
680
+ Raised by the server when an issue arises in processing a valid request
681
+ NotAuthorizedException
682
+ The principle specified by the user_id does not have authorization for the requested action
683
+
684
+ """
685
+
686
+ loop = asyncio.get_event_loop()
687
+ response = loop.run_until_complete(
688
+ self._async_clear_valid_metadata_map_value(
689
+ property_name, type_name, actual_value
690
+ )
691
+ )
692
+ return response
693
+
694
+ async def _async_validate_metadata_map_name(
695
+ self, property_name: str, type_name: str, map_name: str
696
+ ) -> bool | str:
697
+ """Validate whether the name found in an open metadata map property is valid. Async version.
698
+
699
+ Parameters
700
+ ----------
701
+ property_name : str
702
+ The name of the property to setup metadata map.
703
+ type_name : str
704
+ The type name of the property.
705
+ map_name: str
706
+ The name of a map to validate.
707
+
708
+ Returns
709
+ -------
710
+ Bool - True, if validated.
711
+
712
+ Raises
713
+ ------
714
+ InvalidParameterException
715
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
716
+ PropertyServerException
717
+ Raised by the server when an issue arises in processing a valid request
718
+ NotAuthorizedException
719
+ The principle specified by the user_id does not have authorization for the requested action
720
+
721
+ """
722
+
723
+ url = (
724
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/valid-metadata/validate-map-name/"
725
+ f"{property_name}?typeName={type_name}&mapName={map_name}"
726
+ )
727
+
728
+ response = await self._async_make_request("GET", url)
729
+ return response.json().get("flag", "No flag found")
730
+
731
+ def validate_metadata_map_name(
732
+ self, property_name: str, type_name: str, map_name: str
733
+ ) -> bool | str:
734
+ """Validate whether the name found in an open metadata map property is valid.
735
+
736
+ Parameters
737
+ ----------
738
+ property_name : str
739
+ The name of the property to setup metadata map.
740
+ type_name : str
741
+ The type name of the property.
742
+ map_name: str
743
+ The name of a map to validate.
744
+
745
+ Returns
746
+ -------
747
+ Bool - True, if validated.
748
+
749
+ Raises
750
+ ------
751
+ InvalidParameterException
752
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
753
+ PropertyServerException
754
+ Raised by the server when an issue arises in processing a valid request
755
+ NotAuthorizedException
756
+ The principle specified by the user_id does not have authorization for the requested action
757
+
758
+ """
759
+
760
+ loop = asyncio.get_event_loop()
761
+ response = loop.run_until_complete(
762
+ self._async_validate_metadata_map_name(property_name, type_name, map_name)
763
+ )
764
+ return response
765
+
766
+ async def _async_validate_metadata_map_value(
767
+ self, property_name: str, type_name: str, map_name: str, actual_value: str
768
+ ) -> bool | str:
769
+ """Validate whether the name found in an open metadata map property is valid. Async version.
770
+
771
+ Parameters
772
+ ----------
773
+ property_name : str
774
+ The name of the property to setup metadata map.
775
+ type_name : str
776
+ The type name of the property.
777
+ map_name: str
778
+ The name of a map to validate.
779
+ actual_value: str
780
+ The actual value associated with the map to validate.
781
+
782
+ Returns
783
+ -------
784
+ Bool - True, if validated.
785
+
786
+ Raises
787
+ ------
788
+ InvalidParameterException
789
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
790
+ PropertyServerException
791
+ Raised by the server when an issue arises in processing a valid request
792
+ NotAuthorizedException
793
+ The principle specified by the user_id does not have authorization for the requested action
794
+
795
+ """
796
+
797
+ url = (
798
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/valid-metadata/validate-map-value/"
799
+ f"{property_name}/{map_name}?typeName={type_name}&actualValue={actual_value}"
800
+ )
801
+
802
+ response = await self._async_make_request("GET", url)
803
+ return response.json().get("flag", "No flag found")
804
+
805
+ def validate_metadata_map_value(
806
+ self, property_name: str, type_name: str, map_name: str, actual_value: str
807
+ ) -> bool | str:
808
+ """Validate whether the name found in an open metadata map property is valid.
809
+
810
+ Parameters
811
+ ----------
812
+ property_name : str
813
+ The name of the property to setup metadata map.
814
+ type_name : str
815
+ The type name of the property.
816
+ map_name: str
817
+ The name of a map to validate.
818
+ actual_value: str
819
+ The actual value associated with the map to validate.
820
+
821
+ Returns
822
+ -------
823
+ Bool - True, if validated.
824
+
825
+ Raises
826
+ ------
827
+ InvalidParameterException
828
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
829
+ PropertyServerException
830
+ Raised by the server when an issue arises in processing a valid request
831
+ NotAuthorizedException
832
+ The principle specified by the user_id does not have authorization for the requested action
833
+
834
+ """
835
+
836
+ loop = asyncio.get_event_loop()
837
+ response = loop.run_until_complete(
838
+ self._async_validate_metadata_map_value(
839
+ property_name, type_name, map_name, actual_value
840
+ )
841
+ )
842
+ return response
843
+
844
+ async def _async_get_valid_metadata_value(
845
+ self, property_name: str, type_name: str, preferred_value: str
846
+ ) -> dict | str:
847
+ """Retrieve details of a specific valid value for a property. Async version.
848
+
849
+ Parameters
850
+ ----------
851
+ property_name : str
852
+ The name of the property to setup metadata map.
853
+ type_name : str
854
+ The type name of the property.
855
+ preferred_value: str
856
+ The preferred value of the property.
857
+
858
+ Returns
859
+ -------
860
+ Dict if the value is found, otherwise an str indicating the value wasn't found.
861
+
862
+ Raises
863
+ ------
864
+ InvalidParameterException
865
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
866
+ PropertyServerException
867
+ Raised by the server when an issue arises in processing a valid request
868
+ NotAuthorizedException
869
+ The principle specified by the user_id does not have authorization for the requested action
870
+
871
+ """
872
+
873
+ url = (
874
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/valid-metadata/get-value/"
875
+ f"{property_name}?typeName={type_name}&preferredValue={preferred_value}"
876
+ )
877
+
878
+ response = await self._async_make_request("GET", url)
879
+ return response.json().get("element", "No value found")
880
+
881
+ def get_valid_metadata_value(
882
+ self, property_name: str, type_name: str, preferred_value: str
883
+ ) -> dict | str:
884
+ """Retrieve details of a specific valid value for a property.
885
+
886
+ Parameters
887
+ ----------
888
+ property_name : str
889
+ The name of the property to setup metadata map.
890
+ type_name : str
891
+ The type name of the property.
892
+ preferred_value: str
893
+ The preferred value of the property.
894
+
895
+ Returns
896
+ -------
897
+ Dict if the value is found, otherwise an str indicating the value wasn't found.
898
+
899
+ Raises
900
+ ------
901
+ InvalidParameterException
902
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
903
+ PropertyServerException
904
+ Raised by the server when an issue arises in processing a valid request
905
+ NotAuthorizedException
906
+ The principle specified by the user_id does not have authorization for the requested action
907
+
908
+ """
909
+ loop = asyncio.get_event_loop()
910
+ response = loop.run_until_complete(
911
+ self._async_get_valid_metadata_value(
912
+ property_name, type_name, preferred_value
913
+ )
914
+ )
915
+ return response
916
+
917
+ async def _async_get_valid_metadata_map_name(
918
+ self, property_name: str, type_name: str, map_name: str
919
+ ) -> dict | str:
920
+ """Retrieve details of a specific valid name for a map property. Async version.
921
+
922
+ Parameters
923
+ ----------
924
+ property_name : str
925
+ The name of the property to setup metadata map.
926
+ type_name : str
927
+ The type name of the property.
928
+ map_name: str
929
+ Map to return details of.
930
+
931
+ Returns
932
+ -------
933
+ Dict if the value is found, otherwise an str indicating the value wasn't found.
934
+
935
+ Raises
936
+ ------
937
+ InvalidParameterException
938
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
939
+ PropertyServerException
940
+ Raised by the server when an issue arises in processing a valid request
941
+ NotAuthorizedException
942
+ The principle specified by the user_id does not have authorization for the requested action
943
+
944
+ """
945
+
946
+ url = (
947
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/valid-metadata/get-map-name/"
948
+ f"{property_name}?typeName={type_name}&mapName={map_name}"
949
+ )
950
+
951
+ response = await self._async_make_request("GET", url)
952
+ return response.json().get("element", "No value found")
92
953
 
93
- def setup_valid_metadata_value(
94
- self, property_name: str, type_name: str, body: dict
95
- ):
96
- """Create or update the valid value for a particular open metadata property name. If the typeName is null,
97
- this valid value applies to properties of this name from all types. The valid value is stored in the
98
- preferredValue property. If a valid value is already set up for this property (with overlapping effective dates)
99
- then the valid value is updated.
954
+ def get_valid_metadata_map_name(
955
+ self, property_name: str, type_name: str, map_name: str
956
+ ) -> dict | str:
957
+ """Retrieve details of a specific valid name for a map property.
100
958
 
101
959
  Parameters
102
960
  ----------
103
961
  property_name : str
104
- The name of the property for which the valid metadata value is being set up.
962
+ The name of the property to setup metadata map.
105
963
  type_name : str
106
- The name of the type for the valid metadata value.
107
- body : dict
108
- The body of the request containing the details of the valid metadata value.
109
-
964
+ The type name of the property.
965
+ map_name: str
966
+ Map to return details of.
110
967
 
111
968
  Returns
112
969
  -------
113
- str
114
- The GUID of the valid metadata value if it was successfully set up, or "GUID failed to be returned"
115
- if the GUID was not returned in the response.
970
+ Dict if the value is found, otherwise an str indicating the value wasn't found.
116
971
 
117
- Notes
118
- -----
972
+ Raises
973
+ ------
974
+ InvalidParameterException
975
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
976
+ PropertyServerException
977
+ Raised by the server when an issue arises in processing a valid request
978
+ NotAuthorizedException
979
+ The principle specified by the user_id does not have authorization for the requested action
119
980
 
120
- Payload structure similar to:
121
- {
122
- "displayName": "",
123
- "description": "",
124
- "preferredValue": "",
125
- "dataType": "",
126
- "isCaseSensitive": false,
127
- "isDeprecated" : false,
128
- "additionalProperties": {
129
- "colour": "purple"
130
- }
131
- }
132
981
  """
133
982
  loop = asyncio.get_event_loop()
134
- loop.run_until_complete(
135
- self._async_setup_valid_metadata_value(property_name, type_name, body)
983
+ response = loop.run_until_complete(
984
+ self._async_get_valid_metadata_map_name(property_name, type_name, map_name)
136
985
  )
137
- return
986
+ return response
138
987
 
139
- async def _async_setup_valid_metadata_map_name(
140
- self, property_name: str, type_name: str, body: dict
141
- ):
142
- """Create or update the valid value for a name that can be stored in a particular open metadata property name.
143
- This property is of type map from name to string. The mapName is stored in the preferredValue property of
144
- validMetadataValue. If the typeName is null, this valid value applies to properties of this name from any
145
- open metadata type. If a valid value is already set up for this property (with overlapping effective dates)
146
- then the valid value is updated. Async Version.
988
+ async def _async_get_valid_metadata_map_value(
989
+ self, property_name: str, type_name: str, preferred_value: str
990
+ ) -> dict | str:
991
+ """Retrieve details of a specific valid value for a map property. Async version.
147
992
 
148
993
  Parameters
149
994
  ----------
@@ -151,98 +996,73 @@ class ValidMetadataManager(Client):
151
996
  The name of the property to setup metadata map.
152
997
  type_name : str
153
998
  The type name of the property.
154
- body : dict
155
- The metadata map setup data.
156
-
999
+ preferred_value: str
1000
+ Preferred value to return details of.
157
1001
 
158
1002
  Returns
159
1003
  -------
160
- None
161
- This method does not return any value.
162
-
163
- Notes
164
- -----
1004
+ Dict if the value is found, otherwise an str indicating the value wasn't found.
165
1005
 
166
- Body strycture similar to:
167
-
168
- {
169
- "displayName": "",
170
- "description": "",
171
- "preferredValue": "put mapName value here",
172
- "dataType": "",
173
- "isCaseSensitive": false,
174
- "isDeprecated" : false
175
- }
1006
+ Raises
1007
+ ------
1008
+ InvalidParameterException
1009
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1010
+ PropertyServerException
1011
+ Raised by the server when an issue arises in processing a valid request
1012
+ NotAuthorizedException
1013
+ The principle specified by the user_id does not have authorization for the requested action
176
1014
 
177
1015
  """
178
1016
 
179
1017
  url = (
180
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/valid-metadata/setup-map-name/{property_name}?"
181
- f"typeName={type_name}"
1018
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/valid-metadata/get-map-value/"
1019
+ f"{property_name}?typeName={type_name}&preferredValue={preferred_value}"
182
1020
  )
183
1021
 
184
- await self._async_make_request("POST", url, body)
185
- return
186
-
187
- async def _async_setup_valid_metadata_type_value(
188
- self, property_name: str, type_name: str, map_name: str
189
- ):
190
- pass
191
-
192
- async def _async_clear_valid_metadata_value(
193
- self, property_name: str, type_name: str, map_name: str
194
- ):
195
- pass
196
-
197
- async def _async_clear_valid_metadata_map_value(
198
- self,
199
- property_name: str,
200
- type_name: str,
201
- map_name: str,
202
- preferred_value: str,
203
- server: str = None,
204
- ):
205
- pass
1022
+ response = await self._async_make_request("GET", url)
1023
+ return response.json().get("element", "No value found")
206
1024
 
207
- async def _async_validate_metadata_value(
208
- self, property_name: str, type_name: str, actual_value: str
209
- ):
210
- pass
1025
+ def get_valid_metadata_map_value(
1026
+ self, property_name: str, type_name: str, preferred_value: str
1027
+ ) -> dict | str:
1028
+ """Retrieve details of a specific valid value for a map property.
211
1029
 
212
- async def _async_validate_metadata_map_name(
213
- self, property_name: str, type_name: str, map_name: str
214
- ):
215
- pass
1030
+ Parameters
1031
+ ----------
1032
+ property_name : str
1033
+ The name of the property to setup metadata map.
1034
+ type_name : str
1035
+ The type name of the property.
1036
+ preferred_value: str
1037
+ Preferred value to return details of.
216
1038
 
217
- async def _async_get_valid_metadata_value(
218
- self,
219
- property_name: str,
220
- type_name: str,
221
- preferred_value: str,
222
- server: str = None,
223
- ):
224
- pass
1039
+ Returns
1040
+ -------
1041
+ Dict if the value is found, otherwise an str indicating the value wasn't found.
225
1042
 
226
- async def _async_get_valid_metadata_map_name(
227
- self, property_name: str, type_name: str, map_name: str
228
- ):
229
- pass
1043
+ Raises
1044
+ ------
1045
+ InvalidParameterException
1046
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1047
+ PropertyServerException
1048
+ Raised by the server when an issue arises in processing a valid request
1049
+ NotAuthorizedException
1050
+ The principle specified by the user_id does not have authorization for the requested action
230
1051
 
231
- async def _async_get_valid_metadata_map_value(
232
- self,
233
- property_name: str,
234
- type_name: str,
235
- map_name: str,
236
- preferred_value: str,
237
- server: str = None,
238
- ):
239
- pass
1052
+ """
1053
+ loop = asyncio.get_event_loop()
1054
+ response = loop.run_until_complete(
1055
+ self._async_get_valid_metadata_map_value(
1056
+ property_name, type_name, preferred_value
1057
+ )
1058
+ )
1059
+ return response
240
1060
 
241
1061
  async def _async_get_valid_metadata_values(
242
1062
  self,
243
1063
  property_name: str,
244
1064
  type_name: str = None,
245
- start_value: int = 0,
1065
+ start_from: int = 0,
246
1066
  page_size: int = None,
247
1067
  ) -> list | str:
248
1068
  """Retrieve list of values for the property. Async version.
@@ -254,6 +1074,10 @@ class ValidMetadataManager(Client):
254
1074
  type_name: str, opt
255
1075
  The Open Metadata type to get the property values for. If not specified then all property values
256
1076
  will be returned.
1077
+ start_from: int, opt
1078
+ Page to start from.
1079
+ page_size: int, opt
1080
+ Number of elements to return per page - if None, then default for class will be used.
257
1081
 
258
1082
 
259
1083
  Returns
@@ -279,14 +1103,18 @@ class ValidMetadataManager(Client):
279
1103
 
280
1104
  url = (
281
1105
  f"{self.platform_url}/servers/{self.view_server}{self.valid_m_command_base}/get-valid-metadata-values/{property_name}"
282
- f"?typeName={type_name}&startFrom={start_value}&pageSize={page_size}"
1106
+ f"?typeName={type_name}&startFrom={start_from}&pageSize={page_size}"
283
1107
  )
284
1108
 
285
1109
  resp = await self._async_make_request("GET", url)
286
1110
  return resp.json().get("elementList", "No elements found")
287
1111
 
288
1112
  def get_valid_metadata_values(
289
- self, property_name: str, type_name: str = None
1113
+ self,
1114
+ property_name: str,
1115
+ type_name: str = None,
1116
+ start_from: int = 0,
1117
+ page_size: int = None,
290
1118
  ) -> list | str:
291
1119
  """Retrieve list of values for the property.
292
1120
 
@@ -297,7 +1125,10 @@ class ValidMetadataManager(Client):
297
1125
  type_name: str, opt
298
1126
  The Open Metadata type to get the property values for. If not specified then all property values
299
1127
  will be returned.
300
-
1128
+ start_from: int, opt
1129
+ Page to start from.
1130
+ page_size: int, opt
1131
+ Number of elements to return per page - if None, then default for class will be used.
301
1132
 
302
1133
  Returns
303
1134
  -------
@@ -318,7 +1149,9 @@ class ValidMetadataManager(Client):
318
1149
  """
319
1150
  loop = asyncio.get_event_loop()
320
1151
  resp = loop.run_until_complete(
321
- self._async_get_valid_metadata_values(property_name, type_name)
1152
+ self._async_get_valid_metadata_values(
1153
+ property_name, type_name, start_from, page_size
1154
+ )
322
1155
  )
323
1156
  return resp
324
1157
 
@@ -342,13 +1175,13 @@ class ValidMetadataManager(Client):
342
1175
  map_name : str
343
1176
  A valid map name that associates a property with a value.
344
1177
  preferred_value : str
345
-
346
-
1178
+ Preferred value to return details of.
347
1179
  start_from: int, [default=0], optional
348
1180
  When multiple pages of results are available, the page number to start from.
349
1181
  page_size: int, [default=None]
350
1182
  The number of items to return in a single page. If not specified, the default will be taken from
351
1183
  the class instance.
1184
+
352
1185
  Returns
353
1186
  -------
354
1187
  List | str
@@ -377,7 +1210,7 @@ class ValidMetadataManager(Client):
377
1210
  )
378
1211
 
379
1212
  resp = await self._async_make_request("GET", url)
380
- return resp.json()
1213
+ return resp.json().get("elementList", "No elements found")
381
1214
 
382
1215
  def get_consistent_metadata_values(
383
1216
  self,
@@ -436,6 +1269,124 @@ class ValidMetadataManager(Client):
436
1269
  )
437
1270
  return resp
438
1271
 
1272
+ async def _async_set_consistent_metadata_values(
1273
+ self,
1274
+ property_name1: str,
1275
+ property_name2: str,
1276
+ type_name1: str,
1277
+ map_name1: str,
1278
+ preferred_value1: str,
1279
+ type_name2: str,
1280
+ map_name2: str,
1281
+ preferred_value2: str,
1282
+ ) -> None:
1283
+ """Set up consistent metadata values relationship between the two property values. Async version.
1284
+
1285
+ Parameters
1286
+ ----------
1287
+ property_name1 : str
1288
+ The name of the first property.
1289
+ property_name2 : str
1290
+ The name of the second property.
1291
+ type_name1 : str
1292
+ The open metadata type that property1 is associated with.
1293
+ map_name1 : str
1294
+ First valid map name.
1295
+ preferred_value1 : str
1296
+ First preferred value.
1297
+ type_name2 : str
1298
+ The open metadata type that property2 is associated with.
1299
+ map_name2 : str
1300
+ Second valid map name.
1301
+ preferred_value2 : str
1302
+ Second preferred value.
1303
+
1304
+ Returns
1305
+ -------
1306
+ None
1307
+
1308
+ Raises
1309
+ ------
1310
+ InvalidParameterException
1311
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1312
+ PropertyServerException
1313
+ Raised by the server when an issue arises in processing a valid request
1314
+ NotAuthorizedException
1315
+ The principle specified by the user_id does not have authorization for the requested action
1316
+
1317
+ """
1318
+
1319
+ url = (
1320
+ f"{self.platform_url}/servers/{self.view_server}{self.valid_m_command_base}/{property_name1}/"
1321
+ f"consistent-metadata-values/{property_name2}?"
1322
+ f"typeName1={type_name1}&mapName1={map_name1}&preferredValue1={preferred_value1}&"
1323
+ f"typeName1={type_name2}&mapName2={map_name2}&preferredValue2={preferred_value2}"
1324
+ )
1325
+
1326
+ await self._async_make_request("POST", url)
1327
+ return
1328
+
1329
+ def set_consistent_metadata_values(
1330
+ self,
1331
+ property_name1: str,
1332
+ property_name2: str,
1333
+ type_name1: str,
1334
+ map_name1: str,
1335
+ preferred_value1: str,
1336
+ type_name2: str,
1337
+ map_name2: str,
1338
+ preferred_value2: str,
1339
+ ) -> None:
1340
+ """Set up consistent metadata values relationship between the two property values.
1341
+
1342
+ Parameters
1343
+ ----------
1344
+ property_name1 : str
1345
+ The name of the first property.
1346
+ property_name2 : str
1347
+ The name of the second property.
1348
+ type_name1 : str
1349
+ The open metadata type that property1 is associated with.
1350
+ map_name1 : str
1351
+ First valid map name.
1352
+ preferred_value1 : str
1353
+ First preferred value.
1354
+ type_name2 : str
1355
+ The open metadata type that property2 is associated with.
1356
+ map_name2 : str
1357
+ Second valid map name.
1358
+ preferred_value2 : str
1359
+ Second preferred value.
1360
+
1361
+ Returns
1362
+ -------
1363
+ None
1364
+
1365
+ Raises
1366
+ ------
1367
+ InvalidParameterException
1368
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1369
+ PropertyServerException
1370
+ Raised by the server when an issue arises in processing a valid request
1371
+ NotAuthorizedException
1372
+ The principle specified by the user_id does not have authorization for the requested action
1373
+
1374
+ """
1375
+ loop = asyncio.get_event_loop()
1376
+ loop.run_until_complete(
1377
+ self._async_set_consistent_metadata_values(
1378
+ property_name1,
1379
+ property_name2,
1380
+ type_name1,
1381
+ map_name1,
1382
+ preferred_value1,
1383
+ type_name2,
1384
+ map_name2,
1385
+ preferred_value2,
1386
+ )
1387
+ )
1388
+ return
1389
+
439
1390
  #
440
1391
  # Get all ...
441
1392
  #
@@ -680,6 +1631,74 @@ class ValidMetadataManager(Client):
680
1631
  #
681
1632
  # Get valid ...
682
1633
  #
1634
+
1635
+ async def _async_get_sub_types(self, type_name: str) -> list | str:
1636
+ """Returns all the TypeDefs for a specific subtype. If a null result is returned it means the
1637
+ type has no subtypes. Async version.
1638
+
1639
+ Parameters
1640
+ ----------
1641
+ type_name : str
1642
+ Type name to retrieve the sub-types for.
1643
+
1644
+ Returns
1645
+ -------
1646
+ List | str
1647
+
1648
+ A list of TypeDefs that can be attached to the specified type.
1649
+
1650
+ Raises
1651
+ ------
1652
+
1653
+ InvalidParameterException
1654
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1655
+ PropertyServerException
1656
+ Raised by the server when an issue arises in processing a valid request
1657
+ NotAuthorizedException
1658
+ The principle specified by the user_id does not have authorization for the requested action
1659
+
1660
+ """
1661
+
1662
+ url = (
1663
+ f"{self.platform_url}/servers/{self.view_server}{self.valid_m_command_base}/open-metadata-types/sub-types/"
1664
+ f"{type_name}"
1665
+ )
1666
+
1667
+ resp = await self._async_make_request("GET", url)
1668
+ return resp.json().get("typeDefs", "No TypeDefs Found")
1669
+
1670
+ def get_sub_types(self, type_name: str) -> list | str:
1671
+ """Returns all the TypeDefs for a specific subtype. If a null result is returned it means the
1672
+ type has no subtypes.
1673
+
1674
+ Parameters
1675
+ ----------
1676
+ type_name : str
1677
+ Type name to retrieve the sub-types for.
1678
+
1679
+ Returns
1680
+ -------
1681
+ List | str
1682
+
1683
+ A list of TypeDefs that can be attached to the specified type.
1684
+
1685
+ Raises
1686
+ ------
1687
+
1688
+ InvalidParameterException
1689
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1690
+ PropertyServerException
1691
+ Raised by the server when an issue arises in processing a valid request
1692
+ NotAuthorizedException
1693
+ The principle specified by the user_id does not have authorization for the requested action
1694
+
1695
+ """
1696
+ loop = asyncio.get_event_loop()
1697
+ resp = loop.run_until_complete(
1698
+ self._async_get_valid_relationship_types(type_name)
1699
+ )
1700
+ return resp
1701
+
683
1702
  async def _async_get_valid_relationship_types(self, entity_type: str) -> list | str:
684
1703
  """Returns all the TypeDefs for relationships that can be attached to the requested entity type.
685
1704
  Async version.