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 track2_azure-mgmt-labservices] [Hub Generated] Review request for Microsoft.LabServices to add version preview/2021-10-01-preview #7343

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: 7 additions & 4 deletions sdk/labservices/azure-mgmt-labservices/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"autorest": "3.0.6369",
"use": "@autorest/[email protected]",
"commit": "90167a86aca9eed5d51c299b262212738e233e2a",
"autorest": "3.4.5",
"use": [
"@autorest/[email protected]",
"@autorest/[email protected]"
],
"commit": "a99d393c26684bbb9b4d66531ed1eb9ba9d11e23",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/labservices/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.6.2 --version=3.0.6369",
"autorest_command": "autorest specification/labservices/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/[email protected].2 --version=3.4.5",
"readme": "specification/labservices/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._managed_labs_client import ManagedLabsClient
from ._lab_services_client import LabServicesClient
from ._version import VERSION

__version__ = VERSION
__all__ = ['ManagedLabsClient']
__all__ = ['LabServicesClient']

try:
from ._patch import patch_sdk # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
from azure.core.credentials import TokenCredential


class ManagedLabsClientConfiguration(Configuration):
"""Configuration for ManagedLabsClient.
class LabServicesClientConfiguration(Configuration):
"""Configuration for LabServicesClient.

Note that all parameters used to create this instance are saved as instance
attributes.

:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The subscription ID.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
"""

Expand All @@ -44,11 +44,11 @@ def __init__(
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(ManagedLabsClientConfiguration, self).__init__(**kwargs)
super(LabServicesClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2018-10-15"
self.api_version = "2021-10-01-preview"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-labservices/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,42 @@
from typing import Any, Optional

from azure.core.credentials import TokenCredential
from azure.core.pipeline.transport import HttpRequest, HttpResponse

from ._configuration import ManagedLabsClientConfiguration
from .operations import ProviderOperationsOperations
from .operations import GlobalUsersOperations
from .operations import LabAccountsOperations
from ._configuration import LabServicesClientConfiguration
from .operations import Operations
from .operations import GalleryImagesOperations
from .operations import OperationResultsOperations
from .operations import LabPlansOperations
from .operations import ImagesOperations
from .operations import LabsOperations
from .operations import EnvironmentSettingsOperations
from .operations import EnvironmentsOperations
from .operations import UsersOperations
from .operations import VirtualMachinesOperations
from .operations import SchedulesOperations
from . import models


class ManagedLabsClient(object):
"""The Managed Labs Client.
class LabServicesClient(object):
"""Azure Lab Services REST API.

:ivar provider_operations: ProviderOperationsOperations operations
:vartype provider_operations: azure.mgmt.labservices.operations.ProviderOperationsOperations
:ivar global_users: GlobalUsersOperations operations
:vartype global_users: azure.mgmt.labservices.operations.GlobalUsersOperations
:ivar lab_accounts: LabAccountsOperations operations
:vartype lab_accounts: azure.mgmt.labservices.operations.LabAccountsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.labservices.operations.Operations
:ivar gallery_images: GalleryImagesOperations operations
:vartype gallery_images: azure.mgmt.labservices.operations.GalleryImagesOperations
:ivar operation_results: OperationResultsOperations operations
:vartype operation_results: azure.mgmt.labservices.operations.OperationResultsOperations
:ivar lab_plans: LabPlansOperations operations
:vartype lab_plans: azure.mgmt.labservices.operations.LabPlansOperations
:ivar images: ImagesOperations operations
:vartype images: azure.mgmt.labservices.operations.ImagesOperations
:ivar labs: LabsOperations operations
:vartype labs: azure.mgmt.labservices.operations.LabsOperations
:ivar environment_settings: EnvironmentSettingsOperations operations
:vartype environment_settings: azure.mgmt.labservices.operations.EnvironmentSettingsOperations
:ivar environments: EnvironmentsOperations operations
:vartype environments: azure.mgmt.labservices.operations.EnvironmentsOperations
:ivar users: UsersOperations operations
:vartype users: azure.mgmt.labservices.operations.UsersOperations
:ivar virtual_machines: VirtualMachinesOperations operations
:vartype virtual_machines: azure.mgmt.labservices.operations.VirtualMachinesOperations
:ivar schedules: SchedulesOperations operations
:vartype schedules: azure.mgmt.labservices.operations.SchedulesOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The subscription ID.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str base_url: Service URL
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
Expand All @@ -69,39 +67,55 @@ def __init__(
# type: (...) -> None
if not base_url:
base_url = 'https://management.azure.com'
self._config = ManagedLabsClientConfiguration(credential, subscription_id, **kwargs)
self._config = LabServicesClientConfiguration(credential, subscription_id, **kwargs)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.provider_operations = ProviderOperationsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.global_users = GlobalUsersOperations(
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)
self.lab_accounts = LabAccountsOperations(
self.operation_results = OperationResultsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(
self.lab_plans = LabPlansOperations(
self._client, self._config, self._serialize, self._deserialize)
self.gallery_images = GalleryImagesOperations(
self.images = ImagesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.labs = LabsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.environment_settings = EnvironmentSettingsOperations(
self.users = UsersOperations(
self._client, self._config, self._serialize, self._deserialize)
self.environments = EnvironmentsOperations(
self.virtual_machines = VirtualMachinesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.users = UsersOperations(
self.schedules = SchedulesOperations(
self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, http_request, **kwargs):
# type: (HttpRequest, Any) -> HttpResponse
"""Runs the network request through the client's chained policies.

:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.HttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

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

def __enter__(self):
# type: () -> ManagedLabsClient
# type: () -> LabServicesClient
self._client.__enter__()
return self

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"chosen_version": "2018-10-15",
"total_api_version_list": ["2018-10-15"],
"chosen_version": "2021-10-01-preview",
"total_api_version_list": ["2021-10-01-preview"],
"client": {
"name": "ManagedLabsClient",
"filename": "_managed_labs_client",
"description": "The Managed Labs Client.",
"name": "LabServicesClient",
"filename": "_lab_services_client",
"description": "Azure Lab Services REST API.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ManagedLabsClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ManagedLabsClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"LabServicesClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"LabServicesClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
},
"global_parameters": {
"sync": {
Expand All @@ -23,7 +23,7 @@
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "The subscription ID.",
"description": "The ID of the target subscription.",
"docstring_type": "str",
"required": true
}
Expand All @@ -37,7 +37,7 @@
},
"subscription_id": {
"signature": "subscription_id: str,",
"description": "The subscription ID.",
"description": "The ID of the target subscription.",
"docstring_type": "str",
"required": true
}
Expand Down Expand Up @@ -98,20 +98,13 @@
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"operation_groups": {
"provider_operations": "ProviderOperationsOperations",
"global_users": "GlobalUsersOperations",
"lab_accounts": "LabAccountsOperations",
"operations": "Operations",
"gallery_images": "GalleryImagesOperations",
"operation_results": "OperationResultsOperations",
"lab_plans": "LabPlansOperations",
"images": "ImagesOperations",
"labs": "LabsOperations",
"environment_settings": "EnvironmentSettingsOperations",
"environments": "EnvironmentsOperations",
"users": "UsersOperations"
},
"operation_mixins": {
"sync_imports": "None",
"async_imports": "None",
"operations": {
}
"users": "UsersOperations",
"virtual_machines": "VirtualMachinesOperations",
"schedules": "SchedulesOperations"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.0.0"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._managed_labs_client import ManagedLabsClient
__all__ = ['ManagedLabsClient']
from ._lab_services_client import LabServicesClient
__all__ = ['LabServicesClient']
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
from azure.core.credentials_async import AsyncTokenCredential


class ManagedLabsClientConfiguration(Configuration):
"""Configuration for ManagedLabsClient.
class LabServicesClientConfiguration(Configuration):
"""Configuration for LabServicesClient.

Note that all parameters used to create this instance are saved as instance
attributes.

:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The subscription ID.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
"""

Expand All @@ -41,11 +41,11 @@ def __init__(
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(ManagedLabsClientConfiguration, self).__init__(**kwargs)
super(LabServicesClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2018-10-15"
self.api_version = "2021-10-01-preview"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-labservices/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Loading