Skip to content

Commit

Permalink
CodeGen from PR 16557 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
[Hub Generated] Review request for Microsoft.LabServices to add version preview/2021-11-15-preview (Azure#16557)

* Adds base for updating Microsoft.LabServices from version preview/2021-10-01-preview to version 2021-11-15-preview

* Updates readme

* Updates API version in new specs and examples

* add locations/usages resource

* fix usages id constraint to allow for empty string

* add skus resource and examples

* add integer format, fix quantity type from string to number

* fix readonly property per arm feedback

Co-authored-by: Nick Depinet <ndepinet@microsoft.com>
  • Loading branch information
SDKAuto and Nick Depinet committed Nov 12, 2021
1 parent 98a07a2 commit e9b9ec4
Show file tree
Hide file tree
Showing 40 changed files with 9,403 additions and 9,747 deletions.
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/python@5.6.2",
"commit": "90167a86aca9eed5d51c299b262212738e233e2a",
"autorest": "3.4.5",
"use": [
"@autorest/python@5.8.4",
"@autorest/modelerfour@4.19.2"
],
"commit": "8fa31bd593fdb90e6d7d57c026670239c69aca12",
"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/modelerfour@4.19.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-11-15-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,48 @@
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 ImagesOperations
from .operations import LabPlansOperations
from .operations import Operations
from .operations import GalleryImagesOperations
from .operations import LabsOperations
from .operations import EnvironmentSettingsOperations
from .operations import EnvironmentsOperations
from .operations import OperationResultsOperations
from .operations import SchedulesOperations
from .operations import UsersOperations
from .operations import VirtualMachinesOperations
from .operations import UsagesOperations
from .operations import SkusOperations
from . import models


class ManagedLabsClient(object):
"""The Managed Labs Client.
class LabServicesClient(object):
"""REST API for managing Azure Lab Services images.
: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 images: ImagesOperations operations
:vartype images: azure.mgmt.labservices.operations.ImagesOperations
:ivar lab_plans: LabPlansOperations operations
:vartype lab_plans: azure.mgmt.labservices.operations.LabPlansOperations
: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 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 operation_results: OperationResultsOperations operations
:vartype operation_results: azure.mgmt.labservices.operations.OperationResultsOperations
:ivar schedules: SchedulesOperations operations
:vartype schedules: azure.mgmt.labservices.operations.SchedulesOperations
: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 usages: UsagesOperations operations
:vartype usages: azure.mgmt.labservices.operations.UsagesOperations
:ivar skus: SkusOperations operations
:vartype skus: azure.mgmt.labservices.operations.SkusOperations
: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 +73,59 @@ 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.images = ImagesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.global_users = GlobalUsersOperations(
self._client, self._config, self._serialize, self._deserialize)
self.lab_accounts = LabAccountsOperations(
self.lab_plans = LabPlansOperations(
self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)
self.gallery_images = GalleryImagesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.labs = LabsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.environment_settings = EnvironmentSettingsOperations(
self.operation_results = OperationResultsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.environments = EnvironmentsOperations(
self.schedules = SchedulesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.users = UsersOperations(
self._client, self._config, self._serialize, self._deserialize)
self.virtual_machines = VirtualMachinesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.usages = UsagesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.skus = SkusOperations(
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-11-15-preview",
"total_api_version_list": ["2021-11-15-preview"],
"client": {
"name": "ManagedLabsClient",
"filename": "_managed_labs_client",
"description": "The Managed Labs Client.",
"name": "LabServicesClient",
"filename": "_lab_services_client",
"description": "REST API for managing Azure Lab Services images.",
"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,15 @@
"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",
"images": "ImagesOperations",
"lab_plans": "LabPlansOperations",
"operations": "Operations",
"gallery_images": "GalleryImagesOperations",
"labs": "LabsOperations",
"environment_settings": "EnvironmentSettingsOperations",
"environments": "EnvironmentsOperations",
"users": "UsersOperations"
},
"operation_mixins": {
"sync_imports": "None",
"async_imports": "None",
"operations": {
}
"operation_results": "OperationResultsOperations",
"schedules": "SchedulesOperations",
"users": "UsersOperations",
"virtual_machines": "VirtualMachinesOperations",
"usages": "UsagesOperations",
"skus": "SkusOperations"
}
}
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-11-15-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

0 comments on commit e9b9ec4

Please sign in to comment.