diracx-client 0.0.1a32__py3-none-any.whl → 0.0.1a34__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.
Files changed (49) hide show
  1. _diracx_client_importer.pth +1 -0
  2. diracx/_client_importer.py +384 -0
  3. diracx/client/__init__.py +12 -4
  4. diracx/client/{generated → _generated}/__init__.py +1 -1
  5. diracx/client/{generated → _generated}/_client.py +5 -5
  6. diracx/client/{generated → _generated}/_configuration.py +1 -1
  7. diracx/client/{generated/aio → _generated}/_patch.py +4 -5
  8. diracx/client/{generated → _generated}/_serialization.py +3 -23
  9. diracx/client/{generated/aio → _generated}/_vendor.py +1 -1
  10. diracx/client/{generated → _generated}/aio/__init__.py +1 -1
  11. diracx/client/{generated → _generated}/aio/_client.py +5 -5
  12. diracx/client/{generated → _generated}/aio/_configuration.py +1 -1
  13. diracx/client/{generated → _generated/aio}/_patch.py +4 -9
  14. diracx/client/{generated → _generated/aio}/_vendor.py +1 -1
  15. diracx/client/{generated → _generated}/aio/operations/__init__.py +1 -1
  16. diracx/client/{generated → _generated}/aio/operations/_operations.py +158 -28
  17. diracx/client/_generated/aio/operations/_patch.py +26 -0
  18. diracx/client/{generated → _generated}/models/__init__.py +11 -1
  19. diracx/client/{generated → _generated}/models/_enums.py +1 -1
  20. diracx/client/{generated → _generated}/models/_models.py +152 -39
  21. diracx/client/{generated → _generated}/models/_patch.py +15 -12
  22. diracx/client/{generated → _generated}/operations/__init__.py +1 -1
  23. diracx/client/{generated → _generated}/operations/_operations.py +178 -28
  24. diracx/client/_generated/operations/_patch.py +26 -0
  25. diracx/client/aio.py +12 -2
  26. diracx/client/models.py +3 -6
  27. diracx/client/patches/auth/aio.py +45 -0
  28. diracx/client/patches/auth/common.py +56 -0
  29. diracx/client/patches/auth/sync.py +41 -0
  30. diracx/client/patches/{aio/utils.py → client/aio.py} +22 -40
  31. diracx/client/patches/client/common.py +196 -0
  32. diracx/client/patches/client/sync.py +141 -0
  33. diracx/client/patches/jobs/aio.py +34 -0
  34. diracx/client/patches/jobs/common.py +85 -0
  35. diracx/client/patches/jobs/sync.py +34 -0
  36. diracx/client/py.typed +0 -1
  37. diracx/client/sync.py +13 -0
  38. {diracx_client-0.0.1a32.dist-info → diracx_client-0.0.1a34.dist-info}/METADATA +3 -4
  39. diracx_client-0.0.1a34.dist-info/RECORD +42 -0
  40. {diracx_client-0.0.1a32.dist-info → diracx_client-0.0.1a34.dist-info}/WHEEL +1 -2
  41. diracx/client/extensions.py +0 -90
  42. diracx/client/generated/aio/operations/_patch.py +0 -126
  43. diracx/client/generated/operations/_patch.py +0 -129
  44. diracx/client/patches/__init__.py +0 -19
  45. diracx/client/patches/aio/__init__.py +0 -18
  46. diracx_client-0.0.1a32.dist-info/RECORD +0 -36
  47. diracx_client-0.0.1a32.dist-info/entry_points.txt +0 -3
  48. diracx_client-0.0.1a32.dist-info/top_level.txt +0 -1
  49. /diracx/client/{generated → _generated}/py.typed +0 -0
@@ -0,0 +1 @@
1
+ import diracx._client_importer
@@ -0,0 +1,384 @@
1
+ """Register a meta path finder to merger diracx.client with extensions.
2
+
3
+ This file is intended to be used with _diracx_client_importer.pth which causes
4
+ it to be registered as part of Python's startup process. This is needed as we
5
+ don't know if diracx.client or yourextenstion.client will be imported first and
6
+ resolving this ambiguity results in circular imports if this is handled within
7
+ the diracx.client module itself.
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ import importlib.abc
13
+ import importlib.util
14
+ import sys
15
+ import types
16
+ from importlib.metadata import entry_points
17
+ from pathlib import Path
18
+
19
+
20
+ class DiracXPathFinder(importlib.abc.MetaPathFinder):
21
+ """A meta path finder that aliases the diracx.client module to an extension.
22
+
23
+ The DiracXPathFinder is responsible for aliasing the diracx.client module to
24
+ an extension. This is done by returning a custom loader that aliases the
25
+ module to the extension's module. The loader is responsible for loading the
26
+ extension's module and setting its __name__ to the alias.
27
+
28
+ The DiracXPathFinder also patches the module with the effect of the
29
+ extension's _patch.py file. This is done by returning a custom loader that
30
+ loads the extension's _patch.py file and applies the patches to the module.
31
+ See DiracXPatchLoader for more information.
32
+ """
33
+
34
+ patched_modules = [
35
+ "diracx.client._generated",
36
+ "diracx.client._generated.operations",
37
+ "diracx.client._generated.aio",
38
+ "diracx.client._generated.aio.operations",
39
+ "diracx.client._generated.models",
40
+ ]
41
+ public_modules = [
42
+ "diracx.client.aio",
43
+ "diracx.client.models",
44
+ "diracx.client.sync",
45
+ ]
46
+ client_modules = ("diracx.client",)
47
+
48
+ @classmethod
49
+ def _build_cache(cls, fullname):
50
+ if not hasattr(cls, "_extension_name_cache"):
51
+ try:
52
+ installed_extension = get_extension_name(fullname)
53
+ except RetryableError:
54
+ return None
55
+ # If we have an extension, we need to update the module names to
56
+ # include the extension's modules.
57
+ if installed_extension not in [None, "diracx"]:
58
+ cls.patched_modules += [
59
+ f"{installed_extension}.{module.split('.', 1)[1]}"
60
+ for module in cls.patched_modules
61
+ ]
62
+ cls.public_modules += [
63
+ f"{installed_extension}.{module.split('.', 1)[1]}"
64
+ for module in cls.public_modules
65
+ ]
66
+ cls.client_modules = ("diracx.client", f"{installed_extension}.client")
67
+ cls._extension_name_cache = installed_extension
68
+ return cls._extension_name_cache
69
+
70
+ @classmethod
71
+ def find_spec(cls, fullname, path, target=None):
72
+ # We only want to intercept the .client modules, defer building the
73
+ # cache until we're confident we need it.
74
+ if not (".client." in fullname or fullname.endswith(".client")):
75
+ return None
76
+ installed_extension = cls._build_cache(fullname)
77
+ if not fullname.startswith(cls.client_modules):
78
+ return None
79
+ if not installed_extension:
80
+ raise ClientDefinitionError("DiracX is not installed.")
81
+ return cls._find_spec(fullname, installed_extension)
82
+
83
+ @classmethod
84
+ def _find_spec(cls, fullname, installed_extension):
85
+ generated_dirs = (
86
+ "diracx.client._generated",
87
+ f"{installed_extension}.client._generated",
88
+ )
89
+ if fullname.startswith(generated_dirs) and not fullname.endswith("._patch"):
90
+ # The auto-generated files should always come from the installed extension
91
+ new_name = f"{installed_extension}.{fullname.split('.', 1)[1]}"
92
+
93
+ elif fullname in cls.public_modules:
94
+ # Override the public modules of the client
95
+ new_name = f"{installed_extension}.{fullname.split('.', 1)[1]}"
96
+
97
+ elif fullname.endswith("._patch") and installed_extension != "diracx":
98
+ # When importing we always want to take patches from plain DiracX
99
+ # The patches from extensions are applied in the DiracXPatchLoader
100
+ diracx_name = f"diracx.{fullname.split('.', 1)[1]}"
101
+ spec = find_spec_ignoring_meta_path_finder(diracx_name)
102
+ spec.loader = RenamingModuleLoader(spec.loader, diracx_name, fullname)
103
+ return spec
104
+
105
+ else:
106
+ # This module has nothing to do with DiracX so return None
107
+ return None
108
+
109
+ spec = find_spec_ignoring_meta_path_finder(new_name)
110
+ spec.name = fullname
111
+ if fullname in cls.patched_modules and installed_extension != "diracx":
112
+ # Find the ModuleSpec for the extension's corresponding _patch.py
113
+ patch_name = f"{new_name}._patch"
114
+ try:
115
+ patch_spec = find_spec_ignoring_meta_path_finder(patch_name)
116
+ except ClientDefinitionError:
117
+ return None
118
+ else:
119
+ if new_name.endswith(".models"):
120
+ raise NotImplementedError(
121
+ "We don't support patching models in extensions"
122
+ )
123
+ spec.loader = DiracXPatchLoader(
124
+ spec.loader, patch_spec, installed_extension, fullname, new_name
125
+ )
126
+ else:
127
+ spec.loader = DiracXAliasLoader(
128
+ spec.loader, installed_extension, fullname, new_name
129
+ )
130
+ return spec
131
+
132
+
133
+ class RenamingModuleLoader(importlib.abc.Loader):
134
+ def __init__(self, loader, real_name, apparent_name):
135
+ self._loader = loader
136
+ self._real_name = real_name
137
+ self._apparent_name = apparent_name
138
+ self._already_execed = False
139
+
140
+ def create_module(self, spec):
141
+ """Create the module using the real module loader.
142
+
143
+ Standard boilerplate for the Python import machinery.
144
+ """
145
+ return self._loader.create_module(spec)
146
+
147
+ def exec_module(self, module):
148
+ sys.modules[self._apparent_name] = sys.modules[self._real_name]
149
+ self._loader.exec_module(module)
150
+
151
+
152
+ class DiracXAliasLoader(importlib.abc.Loader):
153
+ """A loader that aliases a module to another module."""
154
+
155
+ def __init__(self, original_loader, installed_extension, original_name, new_name):
156
+ self.original_loader = original_loader
157
+ self.installed_extension = installed_extension
158
+ self.original_name = original_name
159
+ self.new_name = new_name
160
+ suffix = original_name.split(".", 1)[1]
161
+ if original_name.startswith("diracx."):
162
+ self.other_name = f"{self.installed_extension}.{suffix}"
163
+ else:
164
+ self.other_name = f"diracx.{suffix}"
165
+
166
+ def create_module(self, spec):
167
+ """Create the module using the real module loader.
168
+
169
+ Standard boilerplate for the Python import machinery.
170
+ """
171
+ return self.original_loader.create_module(spec)
172
+
173
+ def exec_module(self, module):
174
+ """Import a module, overriding its __name__ with the alias."""
175
+ # Make it so the __name__ attribute of the module is correct
176
+ # This is needed to make the Loader work correctly
177
+ module.__name__ = self.new_name
178
+ # It is VERY important to populate the sys.modules cache with the alias
179
+ # else you will end up with multiple copies of the module in memory.
180
+ assert (
181
+ self.installed_extension == "diracx" or self.other_name not in sys.modules
182
+ )
183
+ sys.modules[self.other_name] = module
184
+ self.original_loader.exec_module(module)
185
+
186
+
187
+ class DiracXPatchLoader(DiracXAliasLoader):
188
+ """A loader that patches a module with the effect of an extension's _patch.py.
189
+
190
+ Ordinarily, with autorest the _patch.py file would be imported by the
191
+ autogenerated module itself. This works well for the plain DiracX client
192
+ but not for extensions. With extensions we end up having two copies of the
193
+ autorest generated module, one in the extension and one in the plain DiracX.
194
+ The extension's module is roughly a superset of the plain DiracX module,
195
+ which means we can substitute the plain DiracX module with the extension's
196
+ module at runtime. Hypothetically extensions could change the interface in
197
+ incompatible ways however there should be no real reason to do this and it
198
+ is not supported by DiracX. If a extension does wish to dramatically change
199
+ the behavior of a route, they should duplicate it and make the server fail
200
+ with a clear error if the original route is called.
201
+
202
+ In extensions we want to be able to support the following method resolution
203
+ order (assuming all possible patches are being applied):
204
+
205
+ 1. gubbins.client._generated.aio.operations._patch.MyOperationClass
206
+ 2. diracx.client._generated.aio.operations._patch.MyOperationClass
207
+ 3. gubbins.client._generated.aio.operations._operations.MyOperationClass
208
+ 4. builtins.object
209
+
210
+ To achieve this, we:
211
+
212
+ 1. Alias diracx.client._generated.aio.operations._* to actually be
213
+ gubbins.client._generated.aio.operations._*, with exception of the
214
+ _patch.py file.
215
+ 2. When diracx.client._generated.aio.operations.__init__ is imported, it
216
+ will import and apply patches using `from . import _patch`. (This is the
217
+ standard autorest behavior). We use the DiracXPatchLoader to load the
218
+ _patch.py file from the plain DiracX client
219
+ (i.e. diracx.client._generated.aio.operations._patch).
220
+ 3. To overlay the patches from the extension the import of __init__ is
221
+ intercepted (i.e. gubbins.client._generated.aio.operations.__init__) and
222
+ the DiracXPatchLoader is used to load the _patch.py file from the
223
+ extension. This is done by monkeypatching
224
+ gubbins.client._generated.aio.operations._operations with the objects
225
+ which are exposed by gubbins.client._generated.aio.operations.__init__.
226
+ 4. We then trigger the import of the real extension patch module (i.e.
227
+ gubbins.client._generated.aio.operations._patch) which will import the
228
+ classes from _operations which are already the combined classes from
229
+ autorest and the _patch.py from the plain DiracX client.
230
+ 4. Finally we can restore the original objects in _operations and manually
231
+ mutate the gubbins.client._generated.aio.operations.__module__ to overlay
232
+ the contents of gubbins.client._generated.aio.operations._patch.
233
+ """
234
+
235
+ def __init__(
236
+ self, original_loader, patch_spec, installed_extension, original_name, new_name
237
+ ):
238
+ super().__init__(original_loader, installed_extension, original_name, new_name)
239
+ self.patch_spec = patch_spec
240
+
241
+ def exec_module(self, module):
242
+ """Import an autorest generated module with two layers of patches."""
243
+ # Import the real module and set its __name__ to the alias. This will
244
+ # then corrospond to the __init__.py file + the _patch.py file from
245
+ # plain DiracX. When calling self.original_loader.exec_module it will:
246
+ # 1. Import the real module (e.g. aio/__init__.py)
247
+ # 2. Import any submodules (e.g. _operations)
248
+ # 3. Import the patch module from plain DiracX (e.g. _patch.py,
249
+ # overriden by the DiracXPathFinder)
250
+ # 4. Replace the submodules module's objects with anything in ._patch.__all__
251
+ super().exec_module(module)
252
+
253
+ # Find which module should be monkey patched
254
+ if self.new_name.endswith(".operations"):
255
+ to_monkey_patch_name = f"{self.new_name}._operations"
256
+ elif self.new_name.endswith(".models"):
257
+ to_monkey_patch_name = f"{self.new_name}._models"
258
+ elif self.new_name.endswith((".aio", "._generated")):
259
+ to_monkey_patch_name = f"{self.new_name}._client"
260
+ else:
261
+ raise NotImplementedError(f"Unknown module to patch: {self.new_name}")
262
+ to_monkey_patch = importlib.import_module(to_monkey_patch_name)
263
+
264
+ # Backup the original objects and replace them with the patched objects
265
+ backups = {}
266
+ for obj_name in module.__all__:
267
+ obj = getattr(module, obj_name)
268
+ if hasattr(to_monkey_patch, obj_name):
269
+ backups[obj_name] = getattr(to_monkey_patch, obj_name)
270
+ to_monkey_patch.__dict__[obj_name] = obj
271
+
272
+ # Import the patch module so it takes the monkey patched objects and
273
+ # adds it's own modifications.
274
+ patch_module = self.patch_spec.loader.create_module(self.patch_spec)
275
+ if patch_module is None:
276
+ patch_module = types.ModuleType(self.patch_spec.name)
277
+ patch_module.__file__ = self.patch_spec.origin
278
+ patch_module.__loader__ = self.patch_spec.loader
279
+ patch_module.__package__ = self.patch_spec.parent
280
+ self.patch_spec.loader.exec_module(patch_module)
281
+
282
+ # Restore the original objects into the monkey patched module
283
+ for obj_name in module.__all__:
284
+ if obj_name in backups:
285
+ to_monkey_patch.__dict__[obj_name] = backups[obj_name]
286
+ else:
287
+ del to_monkey_patch.__dict__[obj_name]
288
+
289
+ # Patch the real module with the effect of the extension's _patch.py
290
+ for obj_name in patch_module.__all__:
291
+ if obj_name not in module.__all__:
292
+ module.__all__.append(obj_name)
293
+ module.__dict__[obj_name] = patch_module.__dict__[obj_name]
294
+ patch_module.__dict__["patch_sdk"]()
295
+
296
+
297
+ class ClientDefinitionError(Exception):
298
+ """Raised when a diracx.client or a extension thereof is malformed."""
299
+
300
+
301
+ class RetryableError(Exception):
302
+ """Raised when we're in an invalid state but we shouldn't fail catastrophically."""
303
+
304
+
305
+ def find_spec_ignoring_meta_path_finder(name, target=None):
306
+ """Find a module's spec while ignoring the DiracXPathFinder.
307
+
308
+ This is needed to avoid infinite recursion when finding a module's spec.
309
+ The process is split into two steps:
310
+ 1. Find the path of the module using importlib.util.find_spec. This is
311
+ needed to account for redefinition of the module's __path__ that is done
312
+ by the DiracXAliasLoader.
313
+ 2. Iterate over all registered meta path finders and find the module's spec
314
+ using the path found in step 1. Once the spec is found, return it.
315
+
316
+ As the modules imported by the DiracXPathFinder are always expected to be
317
+ present in extensions which provide a custom client, this function raises
318
+ a ClientDefinitionError if the module is not found.
319
+ """
320
+ client_name = f"{name.split('.')[0]}.client"
321
+ spec = importlib.util.find_spec(client_name)
322
+ if spec is None or len(spec.submodule_search_locations) != 1:
323
+ raise ClientDefinitionError(f"Failed to handle {client_name}.client: {spec}")
324
+ path = Path(spec.submodule_search_locations[0])
325
+ for submodule_name in name.split(".")[2:-1]:
326
+ path /= submodule_name
327
+ path = [str(path)]
328
+
329
+ for finder in sys.meta_path:
330
+ if isinstance(finder, DiracXPathFinder):
331
+ continue
332
+ spec = finder.find_spec(name, path, target)
333
+ if spec is not None:
334
+ return spec
335
+ raise ClientDefinitionError(f"Could not find {name}")
336
+
337
+
338
+ def get_extension_name(fullname: str) -> str | None:
339
+ """Yield extension module names in order of priority.
340
+
341
+ NOTE: This function is duplicated in diracx._client_importer to avoid
342
+ importing diracx in the MetaPathFinder as part of unrelated imports
343
+ (e.g. http.client).
344
+ """
345
+ selected = entry_points().select(group="diracx")
346
+ if selected is None:
347
+ raise NotImplementedError(
348
+ "No entry points found for group 'diracx'. Do you have it installed?"
349
+ )
350
+ extensions = set()
351
+ for entry_point in selected.select(name="extension"):
352
+ extensions.add(entry_point.module)
353
+ if len(extensions) == 0:
354
+ return None
355
+ if len(extensions) == 1:
356
+ return extensions.pop()
357
+ if len(extensions) > 2:
358
+ if fullname.startswith(tuple(extensions)):
359
+ raise NotImplementedError(
360
+ f"Expect to find either diracx or diracx + 1 extension: {extensions=}"
361
+ )
362
+ else:
363
+ # We're in an invalid state however the user hasn't yet tried to use
364
+ # DiracX so raise a RetryableError to avoid completely breaking
365
+ # the current Python installation.
366
+ raise RetryableError()
367
+ installed_extension = min(extensions, key=lambda x: x == "diracx")
368
+ # We need to check if the extension provides a .client module, ignoring
369
+ # the DiracXPathFinder to avoid infinite recursion
370
+ parent_spec = importlib.util.find_spec(installed_extension)
371
+ if parent_spec is None:
372
+ raise ClientDefinitionError(f"Failed to find spec for {installed_extension}!")
373
+ client_name = f"{installed_extension}.client"
374
+ for finder in sys.meta_path:
375
+ if isinstance(finder, DiracXPathFinder):
376
+ continue
377
+ spec = finder.find_spec(client_name, parent_spec.submodule_search_locations)
378
+ if spec is not None:
379
+ return installed_extension
380
+ # We didn't find a client module, so fall back to the default client
381
+ return "diracx"
382
+
383
+
384
+ sys.meta_path.insert(0, DiracXPathFinder())
diracx/client/__init__.py CHANGED
@@ -1,7 +1,15 @@
1
- from .extensions import initialize_client
1
+ from __future__ import absolute_import
2
2
 
3
- initialize_client()
3
+ __all__ = [
4
+ "aio",
5
+ "models",
6
+ "sync",
7
+ ]
4
8
 
9
+ from typing import TYPE_CHECKING
5
10
 
6
- from .generated import * # pylint: disable=unused-wildcard-import
7
- from .patches import DiracClient
11
+
12
+ if TYPE_CHECKING:
13
+ from . import aio
14
+ from . import models
15
+ from . import sync
@@ -1,6 +1,6 @@
1
1
  # coding=utf-8
2
2
  # --------------------------------------------------------------------------
3
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.4, generator: @autorest/python@6.31.0)
3
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.4, generator: @autorest/python@6.32.2)
4
4
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
5
5
  # --------------------------------------------------------------------------
6
6
  # pylint: disable=wrong-import-position
@@ -1,6 +1,6 @@
1
1
  # coding=utf-8
2
2
  # --------------------------------------------------------------------------
3
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.4, generator: @autorest/python@6.31.0)
3
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.4, generator: @autorest/python@6.32.2)
4
4
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
5
5
  # --------------------------------------------------------------------------
6
6
 
@@ -27,13 +27,13 @@ class Dirac: # pylint: disable=client-accepts-api-version-keyword
27
27
  """Dirac.
28
28
 
29
29
  :ivar well_known: WellKnownOperations operations
30
- :vartype well_known: generated.operations.WellKnownOperations
30
+ :vartype well_known: _generated.operations.WellKnownOperations
31
31
  :ivar auth: AuthOperations operations
32
- :vartype auth: generated.operations.AuthOperations
32
+ :vartype auth: _generated.operations.AuthOperations
33
33
  :ivar config: ConfigOperations operations
34
- :vartype config: generated.operations.ConfigOperations
34
+ :vartype config: _generated.operations.ConfigOperations
35
35
  :ivar jobs: JobsOperations operations
36
- :vartype jobs: generated.operations.JobsOperations
36
+ :vartype jobs: _generated.operations.JobsOperations
37
37
  :keyword endpoint: Service URL. Required. Default value is "".
38
38
  :paramtype endpoint: str
39
39
  """
@@ -1,6 +1,6 @@
1
1
  # coding=utf-8
2
2
  # --------------------------------------------------------------------------
3
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.4, generator: @autorest/python@6.31.0)
3
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.4, generator: @autorest/python@6.32.2)
4
4
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
5
5
  # --------------------------------------------------------------------------
6
6
 
@@ -6,13 +6,12 @@
6
6
 
7
7
  Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
8
8
  """
9
- from typing import List
10
-
11
-
12
- __all__: List[str] = [
13
- # "DiracClient",
9
+ __all__ = [
10
+ "Dirac",
14
11
  ] # Add all objects you want publicly available to users at this package level
15
12
 
13
+ from ..patches.client.sync import Dirac
14
+
16
15
 
17
16
  def patch_sdk():
18
17
  """Do not remove from this file.
@@ -1,28 +1,8 @@
1
1
  # pylint: disable=line-too-long,useless-suppression,too-many-lines
2
+ # coding=utf-8
2
3
  # --------------------------------------------------------------------------
3
- #
4
- # Copyright (c) Microsoft Corporation. All rights reserved.
5
- #
6
- # The MIT License (MIT)
7
- #
8
- # Permission is hereby granted, free of charge, to any person obtaining a copy
9
- # of this software and associated documentation files (the ""Software""), to
10
- # deal in the Software without restriction, including without limitation the
11
- # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12
- # sell copies of the Software, and to permit persons to whom the Software is
13
- # furnished to do so, subject to the following conditions:
14
- #
15
- # The above copyright notice and this permission notice shall be included in
16
- # all copies or substantial portions of the Software.
17
- #
18
- # THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
- # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24
- # IN THE SOFTWARE.
25
- #
4
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.4, generator: @autorest/python@6.32.2)
5
+ # Changes may cause incorrect behavior and will be lost if the code is regenerated.
26
6
  # --------------------------------------------------------------------------
27
7
 
28
8
  # pyright: reportUnnecessaryTypeIgnoreComment=false
@@ -1,5 +1,5 @@
1
1
  # --------------------------------------------------------------------------
2
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.4, generator: @autorest/python@6.31.0)
2
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.4, generator: @autorest/python@6.32.2)
3
3
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
4
4
  # --------------------------------------------------------------------------
5
5
 
@@ -1,6 +1,6 @@
1
1
  # coding=utf-8
2
2
  # --------------------------------------------------------------------------
3
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.4, generator: @autorest/python@6.31.0)
3
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.4, generator: @autorest/python@6.32.2)
4
4
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
5
5
  # --------------------------------------------------------------------------
6
6
  # pylint: disable=wrong-import-position
@@ -1,6 +1,6 @@
1
1
  # coding=utf-8
2
2
  # --------------------------------------------------------------------------
3
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.4, generator: @autorest/python@6.31.0)
3
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.4, generator: @autorest/python@6.32.2)
4
4
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
5
5
  # --------------------------------------------------------------------------
6
6
 
@@ -27,13 +27,13 @@ class Dirac: # pylint: disable=client-accepts-api-version-keyword
27
27
  """Dirac.
28
28
 
29
29
  :ivar well_known: WellKnownOperations operations
30
- :vartype well_known: generated.aio.operations.WellKnownOperations
30
+ :vartype well_known: _generated.aio.operations.WellKnownOperations
31
31
  :ivar auth: AuthOperations operations
32
- :vartype auth: generated.aio.operations.AuthOperations
32
+ :vartype auth: _generated.aio.operations.AuthOperations
33
33
  :ivar config: ConfigOperations operations
34
- :vartype config: generated.aio.operations.ConfigOperations
34
+ :vartype config: _generated.aio.operations.ConfigOperations
35
35
  :ivar jobs: JobsOperations operations
36
- :vartype jobs: generated.aio.operations.JobsOperations
36
+ :vartype jobs: _generated.aio.operations.JobsOperations
37
37
  :keyword endpoint: Service URL. Required. Default value is "".
38
38
  :paramtype endpoint: str
39
39
  """
@@ -1,6 +1,6 @@
1
1
  # coding=utf-8
2
2
  # --------------------------------------------------------------------------
3
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.4, generator: @autorest/python@6.31.0)
3
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.4, generator: @autorest/python@6.32.2)
4
4
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
5
5
  # --------------------------------------------------------------------------
6
6
 
@@ -6,14 +6,12 @@
6
6
 
7
7
  Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
8
8
  """
9
- from __future__ import annotations
10
-
11
- from typing import List
12
-
13
- __all__: List[str] = [
14
- "DiracClient",
9
+ __all__ = [
10
+ "Dirac"
15
11
  ] # Add all objects you want publicly available to users at this package level
16
12
 
13
+ from ...patches.client.aio import Dirac
14
+
17
15
 
18
16
  def patch_sdk():
19
17
  """Do not remove from this file.
@@ -22,6 +20,3 @@ def patch_sdk():
22
20
  you can't accomplish using the techniques described in
23
21
  https://aka.ms/azsdk/python/dpcodegen/python/customize
24
22
  """
25
-
26
-
27
- from ..patches import DiracClient
@@ -1,5 +1,5 @@
1
1
  # --------------------------------------------------------------------------
2
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.4, generator: @autorest/python@6.31.0)
2
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.4, generator: @autorest/python@6.32.2)
3
3
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
4
4
  # --------------------------------------------------------------------------
5
5
 
@@ -1,6 +1,6 @@
1
1
  # coding=utf-8
2
2
  # --------------------------------------------------------------------------
3
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.4, generator: @autorest/python@6.31.0)
3
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.4, generator: @autorest/python@6.32.2)
4
4
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
5
5
  # --------------------------------------------------------------------------
6
6
  # pylint: disable=wrong-import-position