Skip to content

Commit

Permalink
CodeGen from PR 31145 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge d04677fc3a83e8c5333f9ffed4159e4208b51343 into 366aaa13cdd218b9adac716680e49473673410c8
  • Loading branch information
SDKAuto committed Oct 22, 2024
1 parent b53b7bb commit a1f57fe
Show file tree
Hide file tree
Showing 127 changed files with 16,156 additions and 55,231 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": "8b74a1daf5240beafb6704a04d9a68dd96cbe7ee",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"typespec_src": "specification/batch/Azure.Batch",
"@azure-tools/typespec-python": "0.36.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 a1f57fe

Please sign in to comment.