@autorest/python 5.14.0 → 5.17.0

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.
Files changed (120) hide show
  1. package/ChangeLog.md +91 -2
  2. package/README.md +30 -4
  3. package/autorest/__init__.py +2 -3
  4. package/autorest/black/__init__.py +12 -5
  5. package/autorest/codegen/__init__.py +130 -179
  6. package/autorest/codegen/models/__init__.py +122 -78
  7. package/autorest/codegen/models/base_builder.py +70 -72
  8. package/autorest/codegen/models/base_model.py +7 -5
  9. package/autorest/codegen/models/{base_schema.py → base_type.py} +62 -49
  10. package/autorest/codegen/models/client.py +195 -36
  11. package/autorest/codegen/models/code_model.py +165 -299
  12. package/autorest/codegen/models/combined_type.py +107 -0
  13. package/autorest/codegen/models/constant_type.py +122 -0
  14. package/autorest/codegen/models/credential_types.py +224 -0
  15. package/autorest/codegen/models/dictionary_type.py +116 -0
  16. package/autorest/codegen/models/enum_type.py +195 -0
  17. package/autorest/codegen/models/imports.py +95 -41
  18. package/autorest/codegen/models/list_type.py +134 -0
  19. package/autorest/codegen/models/lro_operation.py +90 -133
  20. package/autorest/codegen/models/lro_paging_operation.py +28 -12
  21. package/autorest/codegen/models/model_type.py +239 -0
  22. package/autorest/codegen/models/operation.py +415 -241
  23. package/autorest/codegen/models/operation_group.py +82 -88
  24. package/autorest/codegen/models/paging_operation.py +101 -117
  25. package/autorest/codegen/models/parameter.py +307 -322
  26. package/autorest/codegen/models/parameter_list.py +366 -357
  27. package/autorest/codegen/models/primitive_types.py +544 -0
  28. package/autorest/codegen/models/property.py +122 -134
  29. package/autorest/codegen/models/request_builder.py +138 -86
  30. package/autorest/codegen/models/request_builder_parameter.py +122 -79
  31. package/autorest/codegen/models/response.py +325 -0
  32. package/autorest/codegen/models/utils.py +17 -1
  33. package/autorest/codegen/serializers/__init__.py +242 -118
  34. package/autorest/codegen/serializers/builder_serializer.py +863 -1027
  35. package/autorest/codegen/serializers/client_serializer.py +148 -82
  36. package/autorest/codegen/serializers/general_serializer.py +44 -47
  37. package/autorest/codegen/serializers/import_serializer.py +96 -31
  38. package/autorest/codegen/serializers/metadata_serializer.py +39 -79
  39. package/autorest/codegen/serializers/model_base_serializer.py +65 -29
  40. package/autorest/codegen/serializers/model_generic_serializer.py +9 -10
  41. package/autorest/codegen/serializers/model_init_serializer.py +4 -2
  42. package/autorest/codegen/serializers/model_python3_serializer.py +29 -22
  43. package/autorest/codegen/serializers/operation_groups_serializer.py +21 -18
  44. package/autorest/codegen/serializers/operations_init_serializer.py +23 -11
  45. package/autorest/codegen/serializers/parameter_serializer.py +174 -0
  46. package/autorest/codegen/serializers/patch_serializer.py +14 -2
  47. package/autorest/codegen/serializers/request_builders_serializer.py +57 -0
  48. package/autorest/codegen/serializers/utils.py +0 -103
  49. package/autorest/codegen/templates/MANIFEST.in.jinja2 +1 -0
  50. package/autorest/codegen/templates/{service_client.py.jinja2 → client.py.jinja2} +7 -7
  51. package/autorest/codegen/templates/config.py.jinja2 +13 -13
  52. package/autorest/codegen/templates/enum.py.jinja2 +4 -4
  53. package/autorest/codegen/templates/enum_container.py.jinja2 +1 -2
  54. package/autorest/codegen/templates/init.py.jinja2 +9 -6
  55. package/autorest/codegen/templates/keywords.jinja2 +14 -1
  56. package/autorest/codegen/templates/lro_operation.py.jinja2 +6 -5
  57. package/autorest/codegen/templates/lro_paging_operation.py.jinja2 +6 -5
  58. package/autorest/codegen/templates/metadata.json.jinja2 +36 -35
  59. package/autorest/codegen/templates/model.py.jinja2 +23 -29
  60. package/autorest/codegen/templates/model_container.py.jinja2 +2 -1
  61. package/autorest/codegen/templates/model_init.py.jinja2 +9 -8
  62. package/autorest/codegen/templates/operation.py.jinja2 +10 -15
  63. package/autorest/codegen/templates/operation_group.py.jinja2 +14 -13
  64. package/autorest/codegen/templates/operation_groups_container.py.jinja2 +1 -2
  65. package/autorest/codegen/templates/operation_tools.jinja2 +8 -2
  66. package/autorest/codegen/templates/operations_folder_init.py.jinja2 +4 -0
  67. package/autorest/codegen/templates/paging_operation.py.jinja2 +7 -8
  68. package/autorest/codegen/templates/patch.py.jinja2 +18 -29
  69. package/autorest/codegen/templates/request_builder.py.jinja2 +20 -13
  70. package/autorest/codegen/templates/setup.py.jinja2 +9 -3
  71. package/autorest/codegen/templates/vendor.py.jinja2 +12 -2
  72. package/autorest/jsonrpc/__init__.py +7 -12
  73. package/autorest/jsonrpc/localapi.py +4 -3
  74. package/autorest/jsonrpc/server.py +28 -9
  75. package/autorest/jsonrpc/stdstream.py +13 -6
  76. package/autorest/m2r/__init__.py +5 -8
  77. package/autorest/m4reformatter/__init__.py +1108 -0
  78. package/autorest/multiapi/__init__.py +24 -14
  79. package/autorest/multiapi/models/client.py +21 -11
  80. package/autorest/multiapi/models/code_model.py +23 -10
  81. package/autorest/multiapi/models/config.py +4 -1
  82. package/autorest/multiapi/models/constant_global_parameter.py +1 -0
  83. package/autorest/multiapi/models/global_parameter.py +2 -1
  84. package/autorest/multiapi/models/global_parameters.py +14 -8
  85. package/autorest/multiapi/models/imports.py +35 -18
  86. package/autorest/multiapi/models/mixin_operation.py +5 -5
  87. package/autorest/multiapi/models/operation_group.py +2 -1
  88. package/autorest/multiapi/models/operation_mixin_group.py +21 -10
  89. package/autorest/multiapi/serializers/__init__.py +20 -25
  90. package/autorest/multiapi/serializers/import_serializer.py +47 -15
  91. package/autorest/multiapi/serializers/multiapi_serializer.py +17 -17
  92. package/autorest/multiapi/templates/multiapi_config.py.jinja2 +3 -3
  93. package/autorest/multiapi/templates/multiapi_init.py.jinja2 +2 -2
  94. package/autorest/multiapi/templates/multiapi_operations_mixin.py.jinja2 +4 -4
  95. package/autorest/multiapi/templates/multiapi_service_client.py.jinja2 +9 -9
  96. package/autorest/multiapi/utils.py +3 -3
  97. package/autorest/postprocess/__init__.py +202 -0
  98. package/autorest/postprocess/get_all.py +19 -0
  99. package/autorest/postprocess/venvtools.py +73 -0
  100. package/autorest/preprocess/__init__.py +209 -0
  101. package/autorest/preprocess/helpers.py +54 -0
  102. package/autorest/{namer → preprocess}/python_mappings.py +25 -32
  103. package/package.json +3 -3
  104. package/run-python3.js +2 -3
  105. package/venvtools.py +1 -1
  106. package/autorest/codegen/models/constant_schema.py +0 -97
  107. package/autorest/codegen/models/credential_schema.py +0 -90
  108. package/autorest/codegen/models/credential_schema_policy.py +0 -77
  109. package/autorest/codegen/models/dictionary_schema.py +0 -103
  110. package/autorest/codegen/models/enum_schema.py +0 -246
  111. package/autorest/codegen/models/list_schema.py +0 -113
  112. package/autorest/codegen/models/object_schema.py +0 -249
  113. package/autorest/codegen/models/primitive_schemas.py +0 -476
  114. package/autorest/codegen/models/request_builder_parameter_list.py +0 -280
  115. package/autorest/codegen/models/rest.py +0 -42
  116. package/autorest/codegen/models/schema_request.py +0 -45
  117. package/autorest/codegen/models/schema_response.py +0 -123
  118. package/autorest/codegen/serializers/rest_serializer.py +0 -57
  119. package/autorest/namer/__init__.py +0 -25
  120. package/autorest/namer/name_converter.py +0 -412
@@ -1,476 +0,0 @@
1
- # -------------------------------------------------------------------------
2
- # Copyright (c) Microsoft Corporation. All rights reserved.
3
- # Licensed under the MIT License. See License.txt in the project root for
4
- # license information.
5
- # --------------------------------------------------------------------------
6
- import logging
7
- import datetime
8
- from enum import Enum
9
- from typing import cast, Any, Dict, List, Optional, Union
10
-
11
- from .base_schema import BaseSchema
12
- from .imports import FileImport, ImportType, TypingSection
13
-
14
-
15
- _LOGGER = logging.getLogger(__name__)
16
-
17
- class RawString(object):
18
- def __init__(self, string: str) -> None:
19
- self.string = string
20
-
21
- def __repr__(self) -> str:
22
- return "r'{}'".format(self.string.replace('\'', '\\\''))
23
-
24
-
25
-
26
- class PrimitiveSchema(BaseSchema):
27
- _TYPE_MAPPINGS = {
28
- "boolean": "bool",
29
- }
30
-
31
- def _to_python_type(self) -> str:
32
- return self._TYPE_MAPPINGS.get(self.yaml_data["type"], "str")
33
-
34
- @property
35
- def serialization_type(self) -> str:
36
- return self._to_python_type()
37
-
38
- @property
39
- def docstring_type(self) -> str:
40
- return self._to_python_type()
41
-
42
- @property
43
- def type_annotation(self) -> str:
44
- return self.docstring_type
45
-
46
- @property
47
- def docstring_text(self) -> str:
48
- return self.docstring_type
49
-
50
- def _add_optional_and_default_value_template_representation(
51
- self,
52
- *,
53
- optional: bool = True,
54
- default_value_declaration: Optional[str] = None,
55
- description: Optional[str] = None,
56
- ):
57
- comment = ""
58
- if optional:
59
- comment += " Optional."
60
- if default_value_declaration:
61
- comment += f" Default value is {default_value_declaration}."
62
- else:
63
- default_value_declaration = self.default_template_representation_declaration
64
- if description:
65
- comment += f" {description}"
66
- if comment:
67
- comment = f"#{comment}"
68
- return f"{default_value_declaration}{comment}"
69
-
70
- def get_json_template_representation(self, **kwargs: Any) -> Any:
71
- if self.default_value:
72
- kwargs["default_value_declaration"] = kwargs.get(
73
- "default_value_declaration",
74
- self.get_declaration(self.default_value)
75
- )
76
- return self._add_optional_and_default_value_template_representation(
77
- **kwargs
78
- )
79
-
80
- @property
81
- def default_template_representation_declaration(self) -> str:
82
- return self.get_declaration(self.docstring_type)
83
-
84
- def get_files_and_data_template_representation(self, **kwargs: Any) -> Any:
85
- """Template of what the files input should look like
86
- """
87
- return self._add_optional_and_default_value_template_representation(
88
- **kwargs
89
- )
90
-
91
- class IOSchema(PrimitiveSchema):
92
-
93
- def __init__(self, namespace, yaml_data) -> None:
94
- super(IOSchema, self).__init__(namespace=namespace, yaml_data=yaml_data)
95
- self.type = "IO"
96
-
97
- @property
98
- def serialization_type(self) -> str:
99
- return self.type
100
-
101
- @property
102
- def docstring_type(self) -> str:
103
- return self.type
104
-
105
- @property
106
- def type_annotation(self) -> str:
107
- return self.docstring_type
108
-
109
- @property
110
- def docstring_text(self) -> str:
111
- return "IO"
112
-
113
- @property
114
- def default_template_representation_declaration(self) -> str:
115
- return self.get_declaration(b"bytes")
116
-
117
- def imports(self) -> FileImport:
118
- file_import = FileImport()
119
- file_import.add_submodule_import("typing", "IO", ImportType.STDLIB, TypingSection.CONDITIONAL)
120
- return file_import
121
-
122
- class AnySchema(PrimitiveSchema):
123
- @property
124
- def serialization_type(self) -> str:
125
- return "object"
126
-
127
- @property
128
- def docstring_type(self) -> str:
129
- return "any"
130
-
131
- @property
132
- def type_annotation(self) -> str:
133
- return "Any"
134
-
135
- @property
136
- def default_template_representation_declaration(self) -> str:
137
- return self.get_declaration({})
138
-
139
- def imports(self) -> FileImport:
140
- file_import = FileImport()
141
- file_import.add_submodule_import("typing", "Any", ImportType.STDLIB, TypingSection.CONDITIONAL)
142
- return file_import
143
-
144
- class JSONSchema(AnySchema):
145
-
146
- @property
147
- def docstring_type(self) -> str:
148
- return "JSONType"
149
-
150
- @property
151
- def type_annotation(self) -> str:
152
- return "JSONType"
153
-
154
-
155
- class NumberSchema(PrimitiveSchema):
156
- def __init__(self, namespace: str, yaml_data: Dict[str, Any]) -> None:
157
- super(NumberSchema, self).__init__(namespace=namespace, yaml_data=yaml_data)
158
- self.precision = cast(int, yaml_data["precision"])
159
- self.multiple = cast(int, yaml_data.get("multipleOf"))
160
- self.maximum = cast(int, yaml_data.get("maximum"))
161
- self.minimum = cast(int, yaml_data.get("minimum"))
162
- self.exclusive_maximum = cast(int, yaml_data.get("exclusiveMaximum"))
163
- self.exclusive_minimum = cast(int, yaml_data.get("exclusiveMinimum"))
164
-
165
- @property
166
- def serialization_constraints(self) -> List[str]:
167
- validation_constraints = [
168
- f"maximum_ex={self.maximum}" if self.maximum is not None and self.exclusive_maximum else None,
169
- f"maximum={self.maximum}" if self.maximum is not None and not self.exclusive_maximum else None,
170
- f"minimum_ex={self.minimum}" if self.minimum is not None and self.exclusive_minimum else None,
171
- f"minimum={self.minimum}" if self.minimum is not None and not self.exclusive_minimum else None,
172
- f"multiple={self.multiple}" if self.multiple else None,
173
- ]
174
- return [x for x in validation_constraints if x is not None]
175
-
176
- @property
177
- def validation_map(self) -> Optional[Dict[str, Union[bool, int, str]]]:
178
- validation_map: Dict[str, Union[bool, int, str]] = {}
179
- if self.maximum is not None:
180
- if self.exclusive_maximum:
181
- validation_map["maximum_ex"] = self.maximum
182
- else:
183
- validation_map["maximum"] = self.maximum
184
- if self.minimum is not None:
185
- if self.exclusive_minimum:
186
- validation_map["minimum_ex"] = self.minimum
187
- else:
188
- validation_map["minimum"] = self.minimum
189
- if self.multiple:
190
- validation_map["multiple"] = self.multiple
191
- return validation_map or None
192
-
193
- @property
194
- def serialization_type(self) -> str:
195
- if self.yaml_data["type"] == "integer":
196
- if self.precision == 64:
197
- return "long"
198
- return "int"
199
- return "float"
200
-
201
- @property
202
- def docstring_type(self) -> str:
203
- if self.yaml_data["type"] == "integer":
204
- if self.precision == 64:
205
- return "long"
206
- return "int"
207
- return "float"
208
-
209
- @property
210
- def type_annotation(self) -> str:
211
- python_type = self.docstring_type
212
- if python_type == "long":
213
- return "int"
214
- return python_type
215
-
216
- @property
217
- def default_template_representation_declaration(self) -> str:
218
- default_value = 0 if self.docstring_type == "int" else 0.0
219
- return self.get_declaration(default_value)
220
-
221
- class StringSchema(PrimitiveSchema):
222
-
223
- def __init__(self, namespace: str, yaml_data: Dict[str, Any]) -> None:
224
- super(StringSchema, self).__init__(namespace=namespace, yaml_data=yaml_data)
225
- self.max_length = cast(int, yaml_data.get("maxLength"))
226
- self.min_length = cast(
227
- int, (yaml_data.get("minLength", 0) if yaml_data.get("maxLength") else yaml_data.get("minLength"))
228
- )
229
- self.pattern = cast(str, yaml_data.get("pattern"))
230
-
231
- @property
232
- def serialization_constraints(self) -> List[str]:
233
- validation_constraints = [
234
- f"max_length={self.max_length}" if self.max_length is not None else None,
235
- f"min_length={self.min_length}" if self.min_length is not None else None,
236
- f"pattern={RawString(self.pattern)}" if self.pattern else None,
237
- ]
238
- return [x for x in validation_constraints if x is not None]
239
-
240
- @property
241
- def validation_map(self) -> Optional[Dict[str, Union[bool, int, str]]]:
242
- validation_map: Dict[str, Union[bool, int, str]] = {}
243
- if self.max_length is not None:
244
- validation_map["max_length"] = self.max_length
245
- if self.min_length is not None:
246
- validation_map["min_length"] = self.min_length
247
- if self.pattern:
248
- # https://github.com/Azure/autorest.python/issues/407
249
- validation_map["pattern"] = RawString(self.pattern) # type: ignore
250
- return validation_map or None
251
-
252
- def get_declaration(self, value) -> str:
253
- return f'"{value}"'
254
-
255
-
256
- class DatetimeSchema(PrimitiveSchema):
257
- def __init__(self, namespace: str, yaml_data: Dict[str, Any]) -> None:
258
- super(DatetimeSchema, self).__init__(namespace=namespace, yaml_data=yaml_data)
259
- self.format = self.Formats(yaml_data["format"])
260
-
261
- class Formats(str, Enum):
262
- datetime = "date-time"
263
- rfc1123 = "date-time-rfc1123"
264
-
265
- @property
266
- def serialization_type(self) -> str:
267
- formats_to_attribute_type = {self.Formats.datetime: "iso-8601", self.Formats.rfc1123: "rfc-1123"}
268
- return formats_to_attribute_type[self.format]
269
-
270
- @property
271
- def docstring_type(self) -> str:
272
- return "~" + self.type_annotation
273
-
274
- @property
275
- def type_annotation(self) -> str:
276
- return "datetime.datetime"
277
-
278
- @property
279
- def docstring_text(self) -> str:
280
- return "datetime"
281
-
282
- def get_declaration(self, value: datetime.datetime) -> str:
283
- """Could be discussed, since technically I should return a datetime object,
284
- but msrest will do fine.
285
- """
286
- return f'"{value}"'
287
-
288
- def imports(self) -> FileImport:
289
- file_import = FileImport()
290
- file_import.add_import("datetime", ImportType.STDLIB)
291
- return file_import
292
-
293
- @property
294
- def default_template_representation_declaration(self):
295
- return self.get_declaration(datetime.datetime(2020, 2, 20))
296
-
297
- class TimeSchema(PrimitiveSchema):
298
- @property
299
- def serialization_type(self) -> str:
300
- return "time"
301
-
302
- @property
303
- def docstring_type(self) -> str:
304
- return "~" + self.type_annotation
305
-
306
- @property
307
- def type_annotation(self) -> str:
308
- return "datetime.time"
309
-
310
- @property
311
- def docstring_text(self) -> str:
312
- return "time"
313
-
314
- def get_declaration(self, value: datetime.time) -> str:
315
- """Could be discussed, since technically I should return a time object,
316
- but msrest will do fine.
317
- """
318
- return f'"{value}"'
319
-
320
- def imports(self) -> FileImport:
321
- file_import = FileImport()
322
- file_import.add_import("datetime", ImportType.STDLIB)
323
- return file_import
324
-
325
- @property
326
- def default_template_representation_declaration(self) -> str:
327
- return self.get_declaration(datetime.time(12, 30, 0))
328
-
329
-
330
- class UnixTimeSchema(PrimitiveSchema):
331
- @property
332
- def serialization_type(self) -> str:
333
- return "unix-time"
334
-
335
- @property
336
- def docstring_type(self) -> str:
337
- return "~" + self.type_annotation
338
-
339
- @property
340
- def type_annotation(self) -> str:
341
- return "datetime.datetime"
342
-
343
- @property
344
- def docstring_text(self) -> str:
345
- return "datetime"
346
-
347
- def get_declaration(self, value: datetime.datetime) -> str:
348
- """Could be discussed, since technically I should return a datetime object,
349
- but msrest will do fine.
350
- """
351
- return f'"{value}"'
352
-
353
- def imports(self) -> FileImport:
354
- file_import = FileImport()
355
- file_import.add_import("datetime", ImportType.STDLIB)
356
- return file_import
357
-
358
- @property
359
- def default_template_representation_declaration(self) -> str:
360
- return self.get_declaration(datetime.datetime(2020, 2, 20))
361
-
362
-
363
- class DateSchema(PrimitiveSchema):
364
- @property
365
- def serialization_type(self) -> str:
366
- return "date"
367
-
368
- @property
369
- def docstring_type(self) -> str:
370
- return "~" + self.type_annotation
371
-
372
- @property
373
- def type_annotation(self) -> str:
374
- return "datetime.date"
375
-
376
- @property
377
- def docstring_text(self) -> str:
378
- return "date"
379
-
380
- def get_declaration(self, value: datetime.date) -> str:
381
- """Could be discussed, since technically I should return a datetime object,
382
- but msrest will do fine.
383
- """
384
- return f'"{value}"'
385
-
386
- def imports(self) -> FileImport:
387
- file_import = FileImport()
388
- file_import.add_import("datetime", ImportType.STDLIB)
389
- return file_import
390
-
391
- @property
392
- def default_template_representation_declaration(self) -> str:
393
- return self.get_declaration(datetime.date(2020, 2, 20))
394
-
395
-
396
- class DurationSchema(PrimitiveSchema):
397
- @property
398
- def serialization_type(self) -> str:
399
- return "duration"
400
-
401
- @property
402
- def docstring_type(self) -> str:
403
- return "~" + self.type_annotation
404
-
405
- @property
406
- def type_annotation(self) -> str:
407
- return "datetime.timedelta"
408
-
409
- @property
410
- def docstring_text(self) -> str:
411
- return "timedelta"
412
-
413
- def get_declaration(self, value: datetime.timedelta) -> str:
414
- """Could be discussed, since technically I should return a datetime object,
415
- but msrest will do fine.
416
- """
417
- return f'"{value}"'
418
-
419
- def imports(self) -> FileImport:
420
- file_import = FileImport()
421
- file_import.add_import("datetime", ImportType.STDLIB)
422
- return file_import
423
-
424
- @property
425
- def default_template_representation_declaration(self) -> str:
426
- return self.get_declaration(datetime.timedelta(1))
427
-
428
-
429
- class ByteArraySchema(PrimitiveSchema):
430
- def __init__(self, namespace: str, yaml_data: Dict[str, Any]) -> None:
431
- super(ByteArraySchema, self).__init__(namespace=namespace, yaml_data=yaml_data)
432
- self.format = self.Formats(yaml_data["format"])
433
-
434
- class Formats(str, Enum):
435
- base64url = "base64url"
436
- byte = "byte"
437
-
438
- @property
439
- def serialization_type(self) -> str:
440
- if self.format == ByteArraySchema.Formats.base64url:
441
- return "base64"
442
- return "bytearray"
443
-
444
- @property
445
- def docstring_type(self) -> str:
446
- if self.format == ByteArraySchema.Formats.base64url:
447
- return "bytes"
448
- return "bytearray"
449
-
450
- def get_declaration(self, value: str) -> str:
451
- if self.format == ByteArraySchema.Formats.base64url:
452
- return f'bytes("{value}", encoding="utf-8")'
453
- return f'bytearray("{value}", encoding="utf-8")'
454
-
455
-
456
- def get_primitive_schema(namespace: str, yaml_data: Dict[str, Any]) -> "PrimitiveSchema":
457
- mapping = {
458
- "integer": NumberSchema,
459
- "number": NumberSchema,
460
- "string": StringSchema,
461
- "char": StringSchema,
462
- "date-time": DatetimeSchema,
463
- "time": TimeSchema,
464
- "unixtime": UnixTimeSchema,
465
- "date": DateSchema,
466
- "duration": DurationSchema,
467
- "byte-array": ByteArraySchema,
468
- "any": AnySchema,
469
- "any-object": AnySchema,
470
- "binary": IOSchema
471
- }
472
- schema_type = yaml_data["type"]
473
- primitive_schema = cast(
474
- PrimitiveSchema, mapping.get(schema_type, PrimitiveSchema).from_yaml(namespace=namespace, yaml_data=yaml_data)
475
- )
476
- return primitive_schema