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
10 changes: 5 additions & 5 deletions sdk/devtestlabs/azure-mgmt-devtestlabs/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "9685ef961fe7931fccdd9bf86afac8bca0b3ae88",
"commit": "d8852f7ddd54174cb6de4fb936874e65b7035d3d",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"autorest": "3.9.7",
"use": [
"@autorest/python@6.2.1",
"@autorest/modelerfour@4.24.3"
"@autorest/python@6.7.1",
"@autorest/modelerfour@4.26.2"
],
"autorest_command": "autorest specification/devtestlabs/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.1 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/devtestlabs/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False",
"readme": "specification/devtestlabs/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

try:
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
from ._patch import * # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

import sys
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
Expand All @@ -15,11 +14,6 @@

from ._version import VERSION

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
Expand All @@ -33,16 +27,16 @@ class DevTestLabsClientConfiguration(Configuration): # pylint: disable=too-many

:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The subscription ID. Required.
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2018-09-15". Note that overriding this
:keyword api_version: Api Version. Default value is "2021-09-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(DevTestLabsClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop("api_version", "2018-09-15") # type: Literal["2018-09-15"]
api_version: str = kwargs.pop("api_version", "2021-09-01")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand All @@ -56,10 +50,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
kwargs.setdefault("sdk_moniker", "mgmt-devtestlabs/{}".format(VERSION))
self._configure(**kwargs)

def _configure(
self, **kwargs # type: Any
):
# type: (...) -> None
def _configure(self, **kwargs: Any) -> None:
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,21 @@
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient

from . import models
from . import models as _models
from ._configuration import DevTestLabsClientConfiguration
from ._serialization import Deserializer, Serializer
from .operations import (
ArmTemplatesOperations,
ArtifactSourcesOperations,
ArtifactsOperations,
CostsOperations,
BastionHostsOperations,
CustomImagesOperations,
DisksOperations,
EnvironmentsOperations,
FormulasOperations,
GalleryImagesOperations,
GlobalSchedulesOperations,
LabSecretsOperations,
LabsOperations,
NotificationChannelsOperations,
Operations,
Expand All @@ -37,6 +38,8 @@
ServiceFabricSchedulesOperations,
ServiceFabricsOperations,
ServiceRunnersOperations,
SharedGalleriesOperations,
SharedImagesOperations,
UsersOperations,
VirtualMachineSchedulesOperations,
VirtualMachinesOperations,
Expand Down Expand Up @@ -65,8 +68,6 @@ class DevTestLabsClient: # pylint: disable=client-accepts-api-version-keyword,t
:vartype arm_templates: azure.mgmt.devtestlabs.operations.ArmTemplatesOperations
:ivar artifacts: ArtifactsOperations operations
:vartype artifacts: azure.mgmt.devtestlabs.operations.ArtifactsOperations
:ivar costs: CostsOperations operations
:vartype costs: azure.mgmt.devtestlabs.operations.CostsOperations
:ivar custom_images: CustomImagesOperations operations
:vartype custom_images: azure.mgmt.devtestlabs.operations.CustomImagesOperations
:ivar formulas: FormulasOperations operations
Expand All @@ -82,8 +83,14 @@ class DevTestLabsClient: # pylint: disable=client-accepts-api-version-keyword,t
:vartype policies: azure.mgmt.devtestlabs.operations.PoliciesOperations
:ivar schedules: SchedulesOperations operations
:vartype schedules: azure.mgmt.devtestlabs.operations.SchedulesOperations
:ivar lab_secrets: LabSecretsOperations operations
:vartype lab_secrets: azure.mgmt.devtestlabs.operations.LabSecretsOperations
:ivar service_runners: ServiceRunnersOperations operations
:vartype service_runners: azure.mgmt.devtestlabs.operations.ServiceRunnersOperations
:ivar shared_galleries: SharedGalleriesOperations operations
:vartype shared_galleries: azure.mgmt.devtestlabs.operations.SharedGalleriesOperations
:ivar shared_images: SharedImagesOperations operations
:vartype shared_images: azure.mgmt.devtestlabs.operations.SharedImagesOperations
:ivar users: UsersOperations operations
:vartype users: azure.mgmt.devtestlabs.operations.UsersOperations
:ivar disks: DisksOperations operations
Expand All @@ -104,13 +111,15 @@ class DevTestLabsClient: # pylint: disable=client-accepts-api-version-keyword,t
azure.mgmt.devtestlabs.operations.VirtualMachineSchedulesOperations
:ivar virtual_networks: VirtualNetworksOperations operations
:vartype virtual_networks: azure.mgmt.devtestlabs.operations.VirtualNetworksOperations
:ivar bastion_hosts: BastionHostsOperations operations
:vartype bastion_hosts: azure.mgmt.devtestlabs.operations.BastionHostsOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The subscription ID. Required.
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2018-09-15". Note that overriding this
:keyword api_version: Api Version. Default value is "2021-09-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand All @@ -125,9 +134,9 @@ def __init__(
**kwargs: Any
) -> None:
self._config = DevTestLabsClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
Expand All @@ -144,7 +153,6 @@ def __init__(
)
self.arm_templates = ArmTemplatesOperations(self._client, self._config, self._serialize, self._deserialize)
self.artifacts = ArtifactsOperations(self._client, self._config, self._serialize, self._deserialize)
self.costs = CostsOperations(self._client, self._config, self._serialize, self._deserialize)
self.custom_images = CustomImagesOperations(self._client, self._config, self._serialize, self._deserialize)
self.formulas = FormulasOperations(self._client, self._config, self._serialize, self._deserialize)
self.gallery_images = GalleryImagesOperations(self._client, self._config, self._serialize, self._deserialize)
Expand All @@ -154,7 +162,12 @@ def __init__(
self.policy_sets = PolicySetsOperations(self._client, self._config, self._serialize, self._deserialize)
self.policies = PoliciesOperations(self._client, self._config, self._serialize, self._deserialize)
self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize)
self.lab_secrets = LabSecretsOperations(self._client, self._config, self._serialize, self._deserialize)
self.service_runners = ServiceRunnersOperations(self._client, self._config, self._serialize, self._deserialize)
self.shared_galleries = SharedGalleriesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.shared_images = SharedImagesOperations(self._client, self._config, self._serialize, self._deserialize)
self.users = UsersOperations(self._client, self._config, self._serialize, self._deserialize)
self.disks = DisksOperations(self._client, self._config, self._serialize, self._deserialize)
self.environments = EnvironmentsOperations(self._client, self._config, self._serialize, self._deserialize)
Expand All @@ -172,6 +185,7 @@ def __init__(
self.virtual_networks = VirtualNetworksOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.bastion_hosts = BastionHostsOperations(self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
Expand All @@ -195,15 +209,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
request_copy.url = self._client.format_url(request_copy.url)
return self._client.send_request(request_copy, **kwargs)

def close(self):
# type: () -> None
def close(self) -> None:
self._client.close()

def __enter__(self):
# type: () -> DevTestLabsClient
def __enter__(self) -> "DevTestLabsClient":
self._client.__enter__()
return self

def __exit__(self, *exc_details):
# type: (Any) -> None
def __exit__(self, *exc_details: Any) -> None:
self._client.__exit__(*exc_details)
Loading