Skip to content

Commit 3511158

Browse files
author
Nicola Camillucci
committed
Regenerated SDK
1 parent 7c0bbda commit 3511158

19 files changed

Lines changed: 75 additions & 28 deletions

File tree

sdk/keyvault/azure-keyvault-administration/apiview-properties.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,6 @@
8181
"azure.keyvault.administration._generated.aio.KeyVaultClient.update_ekm_connection": "KeyVault.updateEkmConnection",
8282
"azure.keyvault.administration._generated.KeyVaultClient.delete_ekm_connection": "KeyVault.deleteEkmConnection",
8383
"azure.keyvault.administration._generated.aio.KeyVaultClient.delete_ekm_connection": "KeyVault.deleteEkmConnection"
84-
}
84+
},
85+
"CrossLanguageVersion": "a3023239f547"
8586
}

sdk/keyvault/azure-keyvault-administration/azure/keyvault/administration/_generated/_client.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10+
import sys
1011
from typing import Any, TYPE_CHECKING
11-
from typing_extensions import Self
1212

1313
from azure.core import PipelineClient
1414
from azure.core.pipeline import policies
@@ -18,6 +18,11 @@
1818
from ._utils.serialization import Deserializer, Serializer
1919
from .operations import RoleAssignmentsOperations, RoleDefinitionsOperations, _KeyVaultClientOperationsMixin
2020

21+
if sys.version_info >= (3, 11):
22+
from typing import Self
23+
else:
24+
from typing_extensions import Self # type: ignore
25+
2126
if TYPE_CHECKING:
2227
from azure.core.credentials import TokenCredential
2328

@@ -38,8 +43,9 @@ class KeyVaultClient(_KeyVaultClientOperationsMixin):
3843
:param credential: Credential used to authenticate requests to the service. Required.
3944
:type credential: ~azure.core.credentials.TokenCredential
4045
:keyword api_version: The API version to use for this operation. Known values are
41-
"2026-01-01-preview". Default value is "2026-01-01-preview". Note that overriding this default
42-
value may result in unsupported behavior.
46+
"2026-01-01-preview" and None. Default value is None. If not set, the operation's default API
47+
version will be used. Note that overriding this default value may result in unsupported
48+
behavior.
4349
:paramtype api_version: str
4450
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
4551
Retry-After header is present.

sdk/keyvault/azure-keyvault-administration/azure/keyvault/administration/_generated/_configuration.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ class KeyVaultClientConfiguration: # pylint: disable=too-many-instance-attribut
2828
:param credential: Credential used to authenticate requests to the service. Required.
2929
:type credential: ~azure.core.credentials.TokenCredential
3030
:keyword api_version: The API version to use for this operation. Known values are
31-
"2026-01-01-preview". Default value is "2026-01-01-preview". Note that overriding this default
32-
value may result in unsupported behavior.
31+
"2026-01-01-preview" and None. Default value is None. If not set, the operation's default API
32+
version will be used. Note that overriding this default value may result in unsupported
33+
behavior.
3334
:paramtype api_version: str
3435
"""
3536

sdk/keyvault/azure-keyvault-administration/azure/keyvault/administration/_generated/_patch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
88
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
99
"""
10+
1011
from typing import List
1112

1213
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level

sdk/keyvault/azure-keyvault-administration/azure/keyvault/administration/_generated/_utils/model_base.py

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,19 @@
2323
from json import JSONEncoder
2424
import xml.etree.ElementTree as ET
2525
from collections.abc import MutableMapping
26-
from typing_extensions import Self
2726
import isodate
2827
from azure.core.exceptions import DeserializationError
2928
from azure.core import CaseInsensitiveEnumMeta
3029
from azure.core.pipeline import PipelineResponse
3130
from azure.core.serialization import _Null
31+
3232
from azure.core.rest import HttpResponse
3333

34+
if sys.version_info >= (3, 11):
35+
from typing import Self
36+
else:
37+
from typing_extensions import Self
38+
3439
_LOGGER = logging.getLogger(__name__)
3540

3641
__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"]
@@ -595,11 +600,7 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None:
595600
class_name = self.__class__.__name__
596601
if len(args) > 1:
597602
raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given")
598-
dict_to_pass = {
599-
rest_field._rest_name: rest_field._default
600-
for rest_field in self._attr_to_rest_field.values()
601-
if rest_field._default is not _UNSET
602-
}
603+
dict_to_pass: dict[str, typing.Any] = {}
603604
if args:
604605
if isinstance(args[0], ET.Element):
605606
dict_to_pass.update(self._init_from_xml(args[0]))
@@ -619,6 +620,14 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None:
619620
if v is not None
620621
}
621622
)
623+
# Apply client default values for fields the caller didn't set so that
624+
# defaults are part of `_data` and therefore included during serialization.
625+
for rf in self._attr_to_rest_field.values():
626+
if rf._default is _UNSET:
627+
continue
628+
if rf._rest_name in dict_to_pass:
629+
continue
630+
dict_to_pass[rf._rest_name] = _create_value(rf, rf._default)
622631
super().__init__(dict_to_pass)
623632

624633
def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]:
@@ -1113,7 +1122,10 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin
11131122
# by this point, type and rest_name will have a value bc we default
11141123
# them in __new__ of the Model class
11151124
# Use _data.get() directly to avoid triggering __getitem__ which clears the cache
1116-
item = obj._data.get(self._rest_name)
1125+
item = obj._data.get(self._rest_name, _UNSET)
1126+
if item is _UNSET:
1127+
# Field not set by user; return the client default if one exists, otherwise None
1128+
return self._default if self._default is not _UNSET else None
11171129
if item is None:
11181130
return item
11191131
if self._is_model:

sdk/keyvault/azure-keyvault-administration/azure/keyvault/administration/_generated/_utils/serialization.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,15 @@
3939
import xml.etree.ElementTree as ET
4040

4141
import isodate # type: ignore
42-
from typing_extensions import Self
4342

4443
from azure.core.exceptions import DeserializationError, SerializationError
4544
from azure.core.serialization import NULL as CoreNull
4645

46+
if sys.version_info >= (3, 11):
47+
from typing import Self
48+
else:
49+
from typing_extensions import Self
50+
4751
_BOM = codecs.BOM_UTF8.decode(encoding="utf-8")
4852

4953
JSON = MutableMapping[str, Any]

sdk/keyvault/azure-keyvault-administration/azure/keyvault/administration/_generated/aio/_client.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10+
import sys
1011
from typing import Any, Awaitable, TYPE_CHECKING
11-
from typing_extensions import Self
1212

1313
from azure.core import AsyncPipelineClient
1414
from azure.core.pipeline import policies
@@ -18,6 +18,11 @@
1818
from ._configuration import KeyVaultClientConfiguration
1919
from .operations import RoleAssignmentsOperations, RoleDefinitionsOperations, _KeyVaultClientOperationsMixin
2020

21+
if sys.version_info >= (3, 11):
22+
from typing import Self
23+
else:
24+
from typing_extensions import Self # type: ignore
25+
2126
if TYPE_CHECKING:
2227
from azure.core.credentials_async import AsyncTokenCredential
2328

@@ -38,8 +43,9 @@ class KeyVaultClient(_KeyVaultClientOperationsMixin):
3843
:param credential: Credential used to authenticate requests to the service. Required.
3944
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
4045
:keyword api_version: The API version to use for this operation. Known values are
41-
"2026-01-01-preview". Default value is "2026-01-01-preview". Note that overriding this default
42-
value may result in unsupported behavior.
46+
"2026-01-01-preview" and None. Default value is None. If not set, the operation's default API
47+
version will be used. Note that overriding this default value may result in unsupported
48+
behavior.
4349
:paramtype api_version: str
4450
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
4551
Retry-After header is present.

sdk/keyvault/azure-keyvault-administration/azure/keyvault/administration/_generated/aio/_configuration.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ class KeyVaultClientConfiguration: # pylint: disable=too-many-instance-attribut
2828
:param credential: Credential used to authenticate requests to the service. Required.
2929
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
3030
:keyword api_version: The API version to use for this operation. Known values are
31-
"2026-01-01-preview". Default value is "2026-01-01-preview". Note that overriding this default
32-
value may result in unsupported behavior.
31+
"2026-01-01-preview" and None. Default value is None. If not set, the operation's default API
32+
version will be used. Note that overriding this default value may result in unsupported
33+
behavior.
3334
:paramtype api_version: str
3435
"""
3536

sdk/keyvault/azure-keyvault-administration/azure/keyvault/administration/_generated/aio/_patch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
88
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
99
"""
10+
1011
from typing import List
1112

1213
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level

sdk/keyvault/azure-keyvault-administration/azure/keyvault/administration/_generated/aio/operations/_operations.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,10 @@ def prepare_request(next_link=None):
465465
)
466466
_next_request_params["api-version"] = self._config.api_version
467467
_request = HttpRequest(
468-
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
468+
"GET",
469+
urllib.parse.urljoin(next_link, _parsed_next_link.path),
470+
headers=_headers,
471+
params=_next_request_params,
469472
)
470473
path_format_arguments = {
471474
"vaultBaseUrl": self._serialize.url(
@@ -897,7 +900,10 @@ def prepare_request(next_link=None):
897900
)
898901
_next_request_params["api-version"] = self._config.api_version
899902
_request = HttpRequest(
900-
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
903+
"GET",
904+
urllib.parse.urljoin(next_link, _parsed_next_link.path),
905+
headers=_headers,
906+
params=_next_request_params,
901907
)
902908
path_format_arguments = {
903909
"vaultBaseUrl": self._serialize.url(

0 commit comments

Comments
 (0)