Skip to content

Commit

Permalink
CodeGen from PR 31901 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 7872738dcd94d14e069a499b4336d9293386d3e2 into 17dbd6e760c42aeacf1db39381fc26e30dda72ca
  • Loading branch information
SDKAuto committed Dec 17, 2024
1 parent 897f81d commit 6642484
Show file tree
Hide file tree
Showing 127 changed files with 15,851 additions and 54,926 deletions.
6 changes: 6 additions & 0 deletions sdk/batch/azure-batch/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"commit": "37cac643c368dd75de2b98d1d0e3b16dea37b2eb",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"typespec_src": "specification/batch/Azure.Batch",
"@azure-tools/typespec-python": "0.37.1"
}
12 changes: 9 additions & 3 deletions sdk/batch/azure-batch/azure/batch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,28 @@
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wrong-import-position

from ._client import BatchClient
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from ._patch import * # pylint: disable=unused-wildcard-import

from ._client import BatchClient # type: ignore
from ._version import VERSION

__version__ = VERSION

try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import *
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk

__all__ = [
"BatchClient",
]
__all__.extend([p for p in _patch_all if p not in __all__])
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore

_patch_sdk()
8 changes: 4 additions & 4 deletions sdk/batch/azure-batch/azure/batch/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from copy import deepcopy
from typing import Any, TYPE_CHECKING
from typing_extensions import Self

from azure.core import PipelineClient
from azure.core.pipeline import policies
Expand All @@ -18,11 +19,10 @@
from ._serialization import Deserializer, Serializer

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential


class BatchClient(BatchClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
class BatchClient(BatchClientOperationsMixin):
"""BatchClient.
:param endpoint: Batch account endpoint (for example:
Expand All @@ -31,7 +31,7 @@ class BatchClient(BatchClientOperationsMixin): # pylint: disable=client-accepts
:param credential: Credential used to authenticate requests to the service. Required.
:type credential: ~azure.core.credentials.TokenCredential
:keyword api_version: The API version to use for this operation. Default value is
"2024-02-01.19.0". Note that overriding this default value may result in unsupported behavior.
"2024-07-01.20.0". Note that overriding this default value may result in unsupported behavior.
:paramtype api_version: str
"""

Expand Down Expand Up @@ -91,7 +91,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
def close(self) -> None:
self._client.close()

def __enter__(self) -> "BatchClient":
def __enter__(self) -> Self:
self._client.__enter__()
return self

Expand Down
5 changes: 2 additions & 3 deletions sdk/batch/azure-batch/azure/batch/_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from ._version import VERSION

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential


Expand All @@ -29,12 +28,12 @@ class BatchClientConfiguration: # pylint: disable=too-many-instance-attributes
:param credential: Credential used to authenticate requests to the service. Required.
:type credential: ~azure.core.credentials.TokenCredential
:keyword api_version: The API version to use for this operation. Default value is
"2024-02-01.19.0". Note that overriding this default value may result in unsupported behavior.
"2024-07-01.20.0". Note that overriding this default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None:
api_version: str = kwargs.pop("api_version", "2024-02-01.19.0")
api_version: str = kwargs.pop("api_version", "2024-07-01.20.0")

if endpoint is None:
raise ValueError("Parameter 'endpoint' must not be None.")
Expand Down
Loading

0 comments on commit 6642484

Please sign in to comment.