Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-batch] change docs.microsoft.com to learn.microsoft.com #9680

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": "ce46dc3e04b0bc3a7b04d9c715c1107186978a5c",
"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
Loading