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