Skip to content
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
11 changes: 11 additions & 0 deletions sdk/loadtestservice/azure-developer-loadtesting/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commit": "9b4365f3dac7e48df969752be43cad87ae35a26b",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@6.1.11",
"@autorest/modelerfour@4.24.3"
],
"autorest_command": "autorest README.md --use=@autorest/python@6.1.11 --use=@autorest/modelerfour@4.24.3 --version=3.9.2",
"readme": "specification/loadtestservice/data-plane/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# --------------------------------------------------------------------------

from copy import deepcopy
from typing import Any, TYPE_CHECKING
from typing import Any, Optional, TYPE_CHECKING

from azure.core import PipelineClient
from azure.core.rest import HttpRequest, HttpResponse
Expand All @@ -18,8 +18,6 @@

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Dict

from azure.core.credentials import TokenCredential


Expand All @@ -38,14 +36,20 @@ class LoadTestingClient: # pylint: disable=client-accepts-api-version-keyword
:type endpoint: str
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:keyword api_version: Api Version. Default value is "2022-06-01-preview". Note that overriding
this default value may result in unsupported behavior.
:param test_id: Unique name of an existing load test. Default value is None.
:type test_id: str
:keyword api_version: Api Version. Default value is "2022-11-01". 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:
def __init__(
self, endpoint: str, credential: "TokenCredential", test_id: Optional[str] = None, **kwargs: Any
) -> None:
_endpoint = "https://{Endpoint}"
self._config = LoadTestingClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)
self._config = LoadTestingClientConfiguration(
endpoint=endpoint, credential=credential, test_id=test_id, **kwargs
)
self._client = PipelineClient(base_url=_endpoint, config=self._config, **kwargs)

self._serialize = Serializer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import Any, TYPE_CHECKING
from typing import Any, Optional, TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
Expand All @@ -28,14 +28,18 @@ class LoadTestingClientConfiguration(Configuration): # pylint: disable=too-many
:type endpoint: str
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:keyword api_version: Api Version. Default value is "2022-06-01-preview". Note that overriding
this default value may result in unsupported behavior.
:param test_id: Unique name of an existing load test. Default value is None.
:type test_id: str
:keyword api_version: Api Version. Default value is "2022-11-01". 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:
def __init__(
self, endpoint: str, credential: "TokenCredential", test_id: Optional[str] = None, **kwargs: Any
) -> None:
super(LoadTestingClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop("api_version", "2022-06-01-preview") # type: str
api_version = kwargs.pop("api_version", "2022-11-01") # type: str

if endpoint is None:
raise ValueError("Parameter 'endpoint' must not be None.")
Expand All @@ -44,6 +48,7 @@ def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any)

self.endpoint = endpoint
self.credential = credential
self.test_id = test_id
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://loadtest.azure-dev.com/.default"])
kwargs.setdefault("sdk_moniker", "developer-loadtesting/{}".format(VERSION))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1505,7 +1505,7 @@ def failsafe_deserialize(self, target_obj, data, content_type=None):
try:
return self(target_obj, data, content_type=content_type)
except:
_LOGGER.warning(
_LOGGER.debug(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
return None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# --------------------------------------------------------------------------

from copy import deepcopy
from typing import Any, Awaitable, TYPE_CHECKING
from typing import Any, Awaitable, Optional, TYPE_CHECKING

from azure.core import AsyncPipelineClient
from azure.core.rest import AsyncHttpResponse, HttpRequest
Expand All @@ -18,8 +18,6 @@

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Dict

from azure.core.credentials_async import AsyncTokenCredential


Expand All @@ -38,14 +36,20 @@ class LoadTestingClient: # pylint: disable=client-accepts-api-version-keyword
:type endpoint: str
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:keyword api_version: Api Version. Default value is "2022-06-01-preview". Note that overriding
this default value may result in unsupported behavior.
:param test_id: Unique name of an existing load test. Default value is None.
:type test_id: str
:keyword api_version: Api Version. Default value is "2022-11-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: Any) -> None:
def __init__(
self, endpoint: str, credential: "AsyncTokenCredential", test_id: Optional[str] = None, **kwargs: Any
) -> None:
_endpoint = "https://{Endpoint}"
self._config = LoadTestingClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)
self._config = LoadTestingClientConfiguration(
endpoint=endpoint, credential=credential, test_id=test_id, **kwargs
)
self._client = AsyncPipelineClient(base_url=_endpoint, config=self._config, **kwargs)

self._serialize = Serializer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import Any, TYPE_CHECKING
from typing import Any, Optional, TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
Expand All @@ -28,14 +28,18 @@ class LoadTestingClientConfiguration(Configuration): # pylint: disable=too-many
:type endpoint: str
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:keyword api_version: Api Version. Default value is "2022-06-01-preview". Note that overriding
this default value may result in unsupported behavior.
:param test_id: Unique name of an existing load test. Default value is None.
:type test_id: str
:keyword api_version: Api Version. Default value is "2022-11-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: Any) -> None:
def __init__(
self, endpoint: str, credential: "AsyncTokenCredential", test_id: Optional[str] = None, **kwargs: Any
) -> None:
super(LoadTestingClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop("api_version", "2022-06-01-preview") # type: str
api_version = kwargs.pop("api_version", "2022-11-01") # type: str

if endpoint is None:
raise ValueError("Parameter 'endpoint' must not be None.")
Expand All @@ -44,6 +48,7 @@ def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs:

self.endpoint = endpoint
self.credential = credential
self.test_id = test_id
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://loadtest.azure-dev.com/.default"])
kwargs.setdefault("sdk_moniker", "developer-loadtesting/{}".format(VERSION))
Expand Down
Loading