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-compute] [test] stable and has breaking change 4 #6369

Closed
wants to merge 1 commit into from
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
9 changes: 5 additions & 4 deletions sdk/compute/azure-mgmt-compute/_meta.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"commit": "4792bce7667477529991457890b4a6b670e70508",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"commit": "98df17f623b5197973148ff32dcc0a6cac2abbb8",
"repository_url": "https://github.com/test-repo-billy/azure-rest-api-specs",
"autorest": "3.9.7",
"use": [
"@autorest/[email protected]",
"@autorest/[email protected]"
],
"autorest_command": "autorest specification/compute/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/[email protected] --use=@autorest/[email protected] --version=3.9.7 --version-tolerant=False",
"autorest_command": "autorest specification/compute/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/[email protected] --use=@autorest/[email protected] --version=3.9.7 --version-tolerant=False",
"readme": "specification/compute/resource-manager/readme.md",
"package-2023-03-01-only": "2023-04-17 22:42:05 -0400 b06a6f45e472dd07c2e0dab06b1e52dfe2684c88 Microsoft.Compute/ComputeRP/stable/2023-03-01/virtualMachineScaleSet.json",
"package-2023-01-02-only": "2023-06-28 00:48:15 -0400 b1d41f8dc643415d4dc6ee82bdb2fef04ef45bc9 Microsoft.Compute/DiskRP/stable/2023-01-02/snapshot.json",
Expand Down Expand Up @@ -51,5 +51,6 @@
"package-2023-04-02-only": "2023-08-07 20:58:57 -0400 b9403296f0b0e112b0d8222ad05fd1d79ee10e03 Microsoft.Compute/DiskRP/stable/2023-04-02/snapshot.json",
"package-2023-09-01-only": "2023-12-05 16:05:55 -0500 378977e71101fdf224414b86e9f7d8c776cd07ec Microsoft.Compute/ComputeRP/stable/2023-09-01/virtualMachineScaleSet.json",
"package-2022-08-03-only": "2023-11-28 14:37:35 -0500 a4d77e0bd0f00b66d42940a9be143fdb38534b1e Microsoft.Compute/GalleryRP/stable/2022-08-03/sharedGallery.json",
"package-2023-10-02-only": "2023-12-19 03:18:52 -0500 4a4e7c0083937d49061641e857bc876043bb1f5b Microsoft.Compute/DiskRP/stable/2023-10-02/snapshot.json"
"package-2023-10-02-only": "2023-12-19 03:18:52 -0500 4a4e7c0083937d49061641e857bc876043bb1f5b Microsoft.Compute/DiskRP/stable/2023-10-02/snapshot.json",
"package-2023-07-03-only": "2024-02-08 13:16:01 -0500 f715b7fee5e648d06b17467b08473f6cbeee84e0 Microsoft.Compute/GalleryRP/stable/2023-07-03/sharedGallery.json"
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# license information.
# --------------------------------------------------------------------------
from .v2021_07_01.models import *
from .v2022_08_03.models import *
from .v2022_09_04.models import *
from .v2023_07_03.models import *
from .v2023_09_01.models import *
from .v2023_10_02.models import *
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._compute_management_client import ComputeManagementClient
from ._version import VERSION

__version__ = VERSION

try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk

__all__ = [
"ComputeManagementClient",
]
__all__.extend([p for p in _patch_all if p not in __all__])

_patch_sdk()
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from copy import deepcopy
from typing import Any, TYPE_CHECKING

from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient

from . import models as _models
from .._serialization import Deserializer, Serializer
from ._configuration import ComputeManagementClientConfiguration
from .operations import (
CommunityGalleriesOperations,
CommunityGalleryImageVersionsOperations,
CommunityGalleryImagesOperations,
GalleriesOperations,
GalleryApplicationVersionsOperations,
GalleryApplicationsOperations,
GalleryImageVersionsOperations,
GalleryImagesOperations,
GallerySharingProfileOperations,
SharedGalleriesOperations,
SharedGalleryImageVersionsOperations,
SharedGalleryImagesOperations,
)

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential


class ComputeManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""Compute Client.

:ivar galleries: GalleriesOperations operations
:vartype galleries: azure.mgmt.compute.v2023_07_03.operations.GalleriesOperations
:ivar gallery_images: GalleryImagesOperations operations
:vartype gallery_images: azure.mgmt.compute.v2023_07_03.operations.GalleryImagesOperations
:ivar gallery_image_versions: GalleryImageVersionsOperations operations
:vartype gallery_image_versions:
azure.mgmt.compute.v2023_07_03.operations.GalleryImageVersionsOperations
:ivar gallery_applications: GalleryApplicationsOperations operations
:vartype gallery_applications:
azure.mgmt.compute.v2023_07_03.operations.GalleryApplicationsOperations
:ivar gallery_application_versions: GalleryApplicationVersionsOperations operations
:vartype gallery_application_versions:
azure.mgmt.compute.v2023_07_03.operations.GalleryApplicationVersionsOperations
:ivar gallery_sharing_profile: GallerySharingProfileOperations operations
:vartype gallery_sharing_profile:
azure.mgmt.compute.v2023_07_03.operations.GallerySharingProfileOperations
:ivar shared_galleries: SharedGalleriesOperations operations
:vartype shared_galleries: azure.mgmt.compute.v2023_07_03.operations.SharedGalleriesOperations
:ivar shared_gallery_images: SharedGalleryImagesOperations operations
:vartype shared_gallery_images:
azure.mgmt.compute.v2023_07_03.operations.SharedGalleryImagesOperations
:ivar shared_gallery_image_versions: SharedGalleryImageVersionsOperations operations
:vartype shared_gallery_image_versions:
azure.mgmt.compute.v2023_07_03.operations.SharedGalleryImageVersionsOperations
:ivar community_galleries: CommunityGalleriesOperations operations
:vartype community_galleries:
azure.mgmt.compute.v2023_07_03.operations.CommunityGalleriesOperations
:ivar community_gallery_images: CommunityGalleryImagesOperations operations
:vartype community_gallery_images:
azure.mgmt.compute.v2023_07_03.operations.CommunityGalleryImagesOperations
:ivar community_gallery_image_versions: CommunityGalleryImageVersionsOperations operations
:vartype community_gallery_image_versions:
azure.mgmt.compute.v2023_07_03.operations.CommunityGalleryImageVersionsOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call. 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 "2023-07-03". 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
Retry-After header is present.
"""

def __init__(
self,
credential: "TokenCredential",
subscription_id: str,
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
self._config = ComputeManagementClientConfiguration(
credential=credential, subscription_id=subscription_id, **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)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.galleries = GalleriesOperations(
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
)
self.gallery_images = GalleryImagesOperations(
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
)
self.gallery_image_versions = GalleryImageVersionsOperations(
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
)
self.gallery_applications = GalleryApplicationsOperations(
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
)
self.gallery_application_versions = GalleryApplicationVersionsOperations(
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
)
self.gallery_sharing_profile = GallerySharingProfileOperations(
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
)
self.shared_galleries = SharedGalleriesOperations(
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
)
self.shared_gallery_images = SharedGalleryImagesOperations(
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
)
self.shared_gallery_image_versions = SharedGalleryImageVersionsOperations(
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
)
self.community_galleries = CommunityGalleriesOperations(
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
)
self.community_gallery_images = CommunityGalleryImagesOperations(
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
)
self.community_gallery_image_versions = CommunityGalleryImageVersionsOperations(
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
)

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

>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = client._send_request(request)
<HttpResponse: 200 OK>

For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request

:param request: The network request you want to make. Required.
:type request: ~azure.core.rest.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.rest.HttpResponse
"""

request_copy = deepcopy(request)
request_copy.url = self._client.format_url(request_copy.url)
return self._client.send_request(request_copy, **kwargs)

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

def __enter__(self) -> "ComputeManagementClient":
self._client.__enter__()
return self

def __exit__(self, *exc_details: Any) -> None:
self._client.__exit__(*exc_details)
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy

from ._version import VERSION

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential


class ComputeManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
"""Configuration for ComputeManagementClient.

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. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2023-07-03". 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(ComputeManagementClientConfiguration, self).__init__(**kwargs)
api_version: str = kwargs.pop("api_version", "2023-07-03")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")

self.credential = credential
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-compute/{}".format(VERSION))
self._configure(**kwargs)

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)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = ARMChallengeAuthenticationPolicy(
self.credential, *self.credential_scopes, **kwargs
)
Loading