Skip to content

Commit 402f760

Browse files
author
SDKAuto
committed
CodeGen from PR 31901 in Azure/azure-rest-api-specs
Merge 134dab2ea4de63069e9d51cf7bfcf516ed213a6b into 59799c650469a665614dd88c261ade7b78dcf77d
1 parent 9b941a1 commit 402f760

File tree

95 files changed

+17228
-15043
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+17228
-15043
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"commit": "ce46dc3e04b0bc3a7b04d9c715c1107186978a5c",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"typespec_src": "specification/loadtestservice/LoadTestService",
5+
"@azure-tools/typespec-python": "0.37.1"
6+
}
Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,38 @@
1-
# -------------------------------------------------------------------------
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
23
# Copyright (c) Microsoft Corporation. All rights reserved.
3-
# Licensed under the MIT License. See License.txt in the project root for
4-
# license information.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) Python Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
57
# --------------------------------------------------------------------------
6-
from ._client import LoadTestAdministrationClient, LoadTestRunClient
8+
# pylint: disable=wrong-import-position
9+
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._client import LoadTestAdministrationClient # type: ignore
16+
from ._client import LoadTestRunClient # type: ignore
17+
from ._client import LoadTestAdministrationClient # type: ignore
18+
from ._client import LoadTestRunClient # type: ignore
719
from ._version import VERSION
820

921
__version__ = VERSION
10-
__all__ = ["LoadTestAdministrationClient", "LoadTestRunClient"]
22+
23+
try:
24+
from ._patch import __all__ as _patch_all
25+
from ._patch import *
26+
except ImportError:
27+
_patch_all = []
28+
from ._patch import patch_sdk as _patch_sdk
29+
30+
__all__ = [
31+
"LoadTestAdministrationClient",
32+
"LoadTestRunClient",
33+
"LoadTestAdministrationClient",
34+
"LoadTestRunClient",
35+
]
36+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
37+
38+
_patch_sdk()

sdk/loadtesting/azure-developer-loadtesting/azure/developer/loadtesting/_client.py

Lines changed: 262 additions & 33 deletions
Large diffs are not rendered by default.
Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) Python Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from typing import Any, TYPE_CHECKING
10+
11+
from azure.core.pipeline import policies
12+
13+
from ._version import VERSION
14+
15+
if TYPE_CHECKING:
16+
from azure.core.credentials import TokenCredential
17+
18+
19+
class LoadTestAdministrationClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
20+
"""Configuration for LoadTestAdministrationClient.
21+
22+
Note that all parameters used to create this instance are saved as instance
23+
attributes.
24+
25+
:param endpoint: Required.
26+
:type endpoint: str
27+
:param credential: Credential used to authenticate requests to the service. Required.
28+
:type credential: ~azure.core.credentials.TokenCredential
29+
:keyword api_version: The API version to use for this operation. Default value is
30+
"2024-12-01-preview". Note that overriding this default value may result in unsupported
31+
behavior.
32+
:paramtype api_version: str
33+
"""
34+
35+
def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None:
36+
api_version: str = kwargs.pop("api_version", "2024-12-01-preview")
37+
38+
if endpoint is None:
39+
raise ValueError("Parameter 'endpoint' must not be None.")
40+
if credential is None:
41+
raise ValueError("Parameter 'credential' must not be None.")
42+
43+
self.endpoint = endpoint
44+
self.credential = credential
45+
self.api_version = api_version
46+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://cnt-prod.loadtesting.azure.com/.default"])
47+
kwargs.setdefault("sdk_moniker", "developer-loadtesting/{}".format(VERSION))
48+
self.polling_interval = kwargs.get("polling_interval", 30)
49+
self._configure(**kwargs)
50+
51+
def _configure(self, **kwargs: Any) -> None:
52+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
53+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
54+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
55+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
56+
self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs)
57+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
58+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
59+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
60+
self.authentication_policy = kwargs.get("authentication_policy")
61+
if self.credential and not self.authentication_policy:
62+
self.authentication_policy = policies.BearerTokenCredentialPolicy(
63+
self.credential, *self.credential_scopes, **kwargs
64+
)
65+
66+
67+
class LoadTestRunClientConfiguration: # pylint: disable=too-many-instance-attributes
68+
"""Configuration for LoadTestRunClient.
69+
70+
Note that all parameters used to create this instance are saved as instance
71+
attributes.
72+
73+
:param endpoint: Required.
74+
:type endpoint: str
75+
:param credential: Credential used to authenticate requests to the service. Required.
76+
:type credential: ~azure.core.credentials.TokenCredential
77+
:keyword api_version: The API version to use for this operation. Default value is
78+
"2024-12-01-preview". Note that overriding this default value may result in unsupported
79+
behavior.
80+
:paramtype api_version: str
81+
"""
82+
83+
def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None:
84+
api_version: str = kwargs.pop("api_version", "2024-12-01-preview")
85+
86+
if endpoint is None:
87+
raise ValueError("Parameter 'endpoint' must not be None.")
88+
if credential is None:
89+
raise ValueError("Parameter 'credential' must not be None.")
90+
91+
self.endpoint = endpoint
92+
self.credential = credential
93+
self.api_version = api_version
94+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://cnt-prod.loadtesting.azure.com/.default"])
95+
kwargs.setdefault("sdk_moniker", "developer-loadtesting/{}".format(VERSION))
96+
self.polling_interval = kwargs.get("polling_interval", 30)
97+
self._configure(**kwargs)
98+
99+
def _configure(self, **kwargs: Any) -> None:
100+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
101+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
102+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
103+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
104+
self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs)
105+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
106+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
107+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
108+
self.authentication_policy = kwargs.get("authentication_policy")
109+
if self.credential and not self.authentication_policy:
110+
self.authentication_policy = policies.BearerTokenCredentialPolicy(
111+
self.credential, *self.credential_scopes, **kwargs
112+
)
113+
114+
115+
class LoadTestAdministrationClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
116+
"""Configuration for LoadTestAdministrationClient.
117+
118+
Note that all parameters used to create this instance are saved as instance
119+
attributes.
120+
121+
:param endpoint: Required.
122+
:type endpoint: str
123+
:param credential: Credential used to authenticate requests to the service. Required.
124+
:type credential: ~azure.core.credentials.TokenCredential
125+
:keyword api_version: The API version to use for this operation. Default value is
126+
"2024-12-01-preview". Note that overriding this default value may result in unsupported
127+
behavior.
128+
:paramtype api_version: str
129+
"""
130+
131+
def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None:
132+
api_version: str = kwargs.pop("api_version", "2024-12-01-preview")
133+
134+
if endpoint is None:
135+
raise ValueError("Parameter 'endpoint' must not be None.")
136+
if credential is None:
137+
raise ValueError("Parameter 'credential' must not be None.")
138+
139+
self.endpoint = endpoint
140+
self.credential = credential
141+
self.api_version = api_version
142+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://cnt-prod.loadtesting.azure.com/.default"])
143+
kwargs.setdefault("sdk_moniker", "developer-loadtesting/{}".format(VERSION))
144+
self.polling_interval = kwargs.get("polling_interval", 30)
145+
self._configure(**kwargs)
146+
147+
def _configure(self, **kwargs: Any) -> None:
148+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
149+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
150+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
151+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
152+
self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs)
153+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
154+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
155+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
156+
self.authentication_policy = kwargs.get("authentication_policy")
157+
if self.credential and not self.authentication_policy:
158+
self.authentication_policy = policies.BearerTokenCredentialPolicy(
159+
self.credential, *self.credential_scopes, **kwargs
160+
)
161+
162+
163+
class LoadTestRunClientConfiguration: # pylint: disable=too-many-instance-attributes
164+
"""Configuration for LoadTestRunClient.
165+
166+
Note that all parameters used to create this instance are saved as instance
167+
attributes.
168+
169+
:param endpoint: Required.
170+
:type endpoint: str
171+
:param credential: Credential used to authenticate requests to the service. Required.
172+
:type credential: ~azure.core.credentials.TokenCredential
173+
:keyword api_version: The API version to use for this operation. Default value is
174+
"2024-12-01-preview". Note that overriding this default value may result in unsupported
175+
behavior.
176+
:paramtype api_version: str
177+
"""
178+
179+
def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None:
180+
api_version: str = kwargs.pop("api_version", "2024-12-01-preview")
181+
182+
if endpoint is None:
183+
raise ValueError("Parameter 'endpoint' must not be None.")
184+
if credential is None:
185+
raise ValueError("Parameter 'credential' must not be None.")
186+
187+
self.endpoint = endpoint
188+
self.credential = credential
189+
self.api_version = api_version
190+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://cnt-prod.loadtesting.azure.com/.default"])
191+
kwargs.setdefault("sdk_moniker", "developer-loadtesting/{}".format(VERSION))
192+
self.polling_interval = kwargs.get("polling_interval", 30)
193+
self._configure(**kwargs)
194+
195+
def _configure(self, **kwargs: Any) -> None:
196+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
197+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
198+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
199+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
200+
self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs)
201+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
202+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
203+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
204+
self.authentication_policy = kwargs.get("authentication_policy")
205+
if self.credential and not self.authentication_policy:
206+
self.authentication_policy = policies.BearerTokenCredentialPolicy(
207+
self.credential, *self.credential_scopes, **kwargs
208+
)

sdk/loadtesting/azure-developer-loadtesting/azure/developer/loadtesting/_generated/__init__.py

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

sdk/loadtesting/azure-developer-loadtesting/azure/developer/loadtesting/_generated/_client.py

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

0 commit comments

Comments
 (0)