Skip to content

Commit 2b83d33

Browse files
author
SDKAuto
committed
CodeGen from PR 30378 in Azure/azure-rest-api-specs
Merge 13a991f9503d8eb50ab2213ab4540aa952c47272 into 98d74b2db60e46ceb7e3b75755e51519cd500485
1 parent 5b78782 commit 2b83d33

35 files changed

+1794
-815
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
recursive-include tests *.py
2-
recursive-include samples *.py
31
include *.md
42
include LICENSE
5-
include azure/__init__.py
6-
include azure/monitor/__init__.py
73
include azure/monitor/ingestion/py.typed
4+
recursive-include tests *.py
5+
recursive-include samples *.py *.md
6+
include azure/__init__.py
7+
include azure/monitor/__init__.py
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"commit": "20b8ba31ffb3814d9001ad9618dc48bf3def925d",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"typespec_src": "specification/monitor/Ingestion",
5+
"@azure-tools/typespec-python": "0.36.1"
6+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore

sdk/monitor/azure-monitor-ingestion/azure/monitor/ingestion/__init__.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,31 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._patch import LogsIngestionClient
10+
from typing import TYPE_CHECKING
1011

12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
1114

12-
from ._patch import LogsUploadError
15+
from ._client import LogsIngestionClient # type: ignore
16+
from ._version import VERSION
17+
18+
__version__ = VERSION
19+
20+
try:
21+
from ._patch import __all__ as _patch_all
22+
from ._patch import *
23+
except ImportError:
24+
_patch_all = []
1325
from ._patch import patch_sdk as _patch_sdk
1426

1527
__all__ = [
16-
"LogsUploadError",
1728
"LogsIngestionClient",
1829
]
19-
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2031

2132
_patch_sdk()

sdk/monitor/azure-monitor-ingestion/azure/monitor/ingestion/_client.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
11+
from typing_extensions import Self
1112

1213
from azure.core import PipelineClient
1314
from azure.core.pipeline import policies
@@ -18,20 +19,18 @@
1819
from ._serialization import Deserializer, Serializer
1920

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

2424

25-
class LogsIngestionClient(LogsIngestionClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
26-
"""Azure Monitor Data Collection Python Client.
25+
class LogsIngestionClient(LogsIngestionClientOperationsMixin):
26+
"""Azure Monitor data collection client.
2727
28-
:param endpoint: The Data Collection Endpoint for the Data Collection Rule, for example
29-
https://dce-name.eastus-2.ingest.monitor.azure.com. Required.
28+
:param endpoint: Required.
3029
:type endpoint: str
31-
:param credential: Credential needed for the client to connect to Azure. Required.
30+
:param credential: Credential used to authenticate requests to the service. Required.
3231
:type credential: ~azure.core.credentials.TokenCredential
33-
:keyword api_version: Api Version. Default value is "2023-01-01". Note that overriding this
34-
default value may result in unsupported behavior.
32+
:keyword api_version: The API version to use for this operation. Default value is "2023-01-01".
33+
Note that overriding this default value may result in unsupported behavior.
3534
:paramtype api_version: str
3635
"""
3736

@@ -90,7 +89,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
9089
def close(self) -> None:
9190
self._client.close()
9291

93-
def __enter__(self) -> "LogsIngestionClient":
92+
def __enter__(self) -> Self:
9493
self._client.__enter__()
9594
return self
9695

sdk/monitor/azure-monitor-ingestion/azure/monitor/ingestion/_configuration.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,32 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

99
from typing import Any, TYPE_CHECKING
1010

1111
from azure.core.pipeline import policies
1212

13+
from ._version import VERSION
14+
1315
if TYPE_CHECKING:
14-
# pylint: disable=unused-import,ungrouped-imports
1516
from azure.core.credentials import TokenCredential
1617

17-
VERSION = "unknown"
18-
1918

20-
class LogsIngestionClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
19+
class LogsIngestionClientConfiguration: # pylint: disable=too-many-instance-attributes
2120
"""Configuration for LogsIngestionClient.
2221
2322
Note that all parameters used to create this instance are saved as instance
2423
attributes.
2524
26-
:param endpoint: The Data Collection Endpoint for the Data Collection Rule, for example
27-
https://dce-name.eastus-2.ingest.monitor.azure.com. Required.
25+
:param endpoint: Required.
2826
:type endpoint: str
29-
:param credential: Credential needed for the client to connect to Azure. Required.
27+
:param credential: Credential used to authenticate requests to the service. Required.
3028
:type credential: ~azure.core.credentials.TokenCredential
31-
:keyword api_version: Api Version. Default value is "2023-01-01". Note that overriding this
32-
default value may result in unsupported behavior.
29+
:keyword api_version: The API version to use for this operation. Default value is "2023-01-01".
30+
Note that overriding this default value may result in unsupported behavior.
3331
:paramtype api_version: str
3432
"""
3533

@@ -44,7 +42,7 @@ def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any)
4442
self.endpoint = endpoint
4543
self.credential = credential
4644
self.api_version = api_version
47-
self.credential_scopes = kwargs.pop("credential_scopes", ["https://monitor.azure.com//.default"])
45+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://monitor.azure.com/.default"])
4846
kwargs.setdefault("sdk_moniker", "monitor-ingestion/{}".format(VERSION))
4947
self.polling_interval = kwargs.get("polling_interval", 30)
5048
self._configure(**kwargs)

sdk/monitor/azure-monitor-ingestion/azure/monitor/ingestion/_helpers.py

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)