Skip to content

Commit b251209

Browse files
author
SDKAuto
committed
CodeGen from PR 3215 in test-repo-billy/azure-rest-api-specs
Merge 9f5cfb70eafe423359d2446fff464d523367102d into d8e7a994129b4ac979c55d3033220ac221241be0
1 parent f15adfa commit b251209

File tree

76 files changed

+19004
-9049
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+19004
-9049
lines changed

sdk/compute/azure-mgmt-compute/_meta.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"commit": "4792bce7667477529991457890b4a6b670e70508",
3-
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
2+
"commit": "98df17f623b5197973148ff32dcc0a6cac2abbb8",
3+
"repository_url": "https://github.com/test-repo-billy/azure-rest-api-specs",
44
"autorest": "3.9.7",
55
"use": [
66
"@autorest/[email protected]",
77
"@autorest/[email protected]"
88
],
9-
"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",
9+
"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",
1010
"readme": "specification/compute/resource-manager/readme.md",
1111
"package-2023-03-01-only": "2023-04-17 22:42:05 -0400 b06a6f45e472dd07c2e0dab06b1e52dfe2684c88 Microsoft.Compute/ComputeRP/stable/2023-03-01/virtualMachineScaleSet.json",
1212
"package-2023-01-02-only": "2023-06-28 00:48:15 -0400 b1d41f8dc643415d4dc6ee82bdb2fef04ef45bc9 Microsoft.Compute/DiskRP/stable/2023-01-02/snapshot.json",
@@ -51,5 +51,6 @@
5151
"package-2023-04-02-only": "2023-08-07 20:58:57 -0400 b9403296f0b0e112b0d8222ad05fd1d79ee10e03 Microsoft.Compute/DiskRP/stable/2023-04-02/snapshot.json",
5252
"package-2023-09-01-only": "2023-12-05 16:05:55 -0500 378977e71101fdf224414b86e9f7d8c776cd07ec Microsoft.Compute/ComputeRP/stable/2023-09-01/virtualMachineScaleSet.json",
5353
"package-2022-08-03-only": "2023-11-28 14:37:35 -0500 a4d77e0bd0f00b66d42940a9be143fdb38534b1e Microsoft.Compute/GalleryRP/stable/2022-08-03/sharedGallery.json",
54-
"package-2023-10-02-only": "2023-12-19 03:18:52 -0500 4a4e7c0083937d49061641e857bc876043bb1f5b Microsoft.Compute/DiskRP/stable/2023-10-02/snapshot.json"
54+
"package-2023-10-02-only": "2023-12-19 03:18:52 -0500 4a4e7c0083937d49061641e857bc876043bb1f5b Microsoft.Compute/DiskRP/stable/2023-10-02/snapshot.json",
55+
"package-2023-07-03-only": "2024-02-08 13:16:01 -0500 f715b7fee5e648d06b17467b08473f6cbeee84e0 Microsoft.Compute/GalleryRP/stable/2023-07-03/sharedGallery.json"
5556
}

sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_compute_management_client.py

Lines changed: 52 additions & 12 deletions
Large diffs are not rendered by default.

sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_compute_management_client.py

Lines changed: 52 additions & 12 deletions
Large diffs are not rendered by default.

sdk/compute/azure-mgmt-compute/azure/mgmt/compute/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# license information.
66
# --------------------------------------------------------------------------
77
from .v2021_07_01.models import *
8-
from .v2022_08_03.models import *
98
from .v2022_09_04.models import *
9+
from .v2023_07_03.models import *
1010
from .v2023_09_01.models import *
1111
from .v2023_10_02.models import *
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from ._compute_management_client import ComputeManagementClient
10+
from ._version import VERSION
11+
12+
__version__ = VERSION
13+
14+
try:
15+
from ._patch import __all__ as _patch_all
16+
from ._patch import * # pylint: disable=unused-wildcard-import
17+
except ImportError:
18+
_patch_all = []
19+
from ._patch import patch_sdk as _patch_sdk
20+
21+
__all__ = [
22+
"ComputeManagementClient",
23+
]
24+
__all__.extend([p for p in _patch_all if p not in __all__])
25+
26+
_patch_sdk()
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from copy import deepcopy
10+
from typing import Any, TYPE_CHECKING
11+
12+
from azure.core.rest import HttpRequest, HttpResponse
13+
from azure.mgmt.core import ARMPipelineClient
14+
15+
from . import models as _models
16+
from .._serialization import Deserializer, Serializer
17+
from ._configuration import ComputeManagementClientConfiguration
18+
from .operations import (
19+
CommunityGalleriesOperations,
20+
CommunityGalleryImageVersionsOperations,
21+
CommunityGalleryImagesOperations,
22+
GalleriesOperations,
23+
GalleryApplicationVersionsOperations,
24+
GalleryApplicationsOperations,
25+
GalleryImageVersionsOperations,
26+
GalleryImagesOperations,
27+
GallerySharingProfileOperations,
28+
SharedGalleriesOperations,
29+
SharedGalleryImageVersionsOperations,
30+
SharedGalleryImagesOperations,
31+
)
32+
33+
if TYPE_CHECKING:
34+
# pylint: disable=unused-import,ungrouped-imports
35+
from azure.core.credentials import TokenCredential
36+
37+
38+
class ComputeManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
39+
"""Compute Client.
40+
41+
:ivar galleries: GalleriesOperations operations
42+
:vartype galleries: azure.mgmt.compute.v2023_07_03.operations.GalleriesOperations
43+
:ivar gallery_images: GalleryImagesOperations operations
44+
:vartype gallery_images: azure.mgmt.compute.v2023_07_03.operations.GalleryImagesOperations
45+
:ivar gallery_image_versions: GalleryImageVersionsOperations operations
46+
:vartype gallery_image_versions:
47+
azure.mgmt.compute.v2023_07_03.operations.GalleryImageVersionsOperations
48+
:ivar gallery_applications: GalleryApplicationsOperations operations
49+
:vartype gallery_applications:
50+
azure.mgmt.compute.v2023_07_03.operations.GalleryApplicationsOperations
51+
:ivar gallery_application_versions: GalleryApplicationVersionsOperations operations
52+
:vartype gallery_application_versions:
53+
azure.mgmt.compute.v2023_07_03.operations.GalleryApplicationVersionsOperations
54+
:ivar gallery_sharing_profile: GallerySharingProfileOperations operations
55+
:vartype gallery_sharing_profile:
56+
azure.mgmt.compute.v2023_07_03.operations.GallerySharingProfileOperations
57+
:ivar shared_galleries: SharedGalleriesOperations operations
58+
:vartype shared_galleries: azure.mgmt.compute.v2023_07_03.operations.SharedGalleriesOperations
59+
:ivar shared_gallery_images: SharedGalleryImagesOperations operations
60+
:vartype shared_gallery_images:
61+
azure.mgmt.compute.v2023_07_03.operations.SharedGalleryImagesOperations
62+
:ivar shared_gallery_image_versions: SharedGalleryImageVersionsOperations operations
63+
:vartype shared_gallery_image_versions:
64+
azure.mgmt.compute.v2023_07_03.operations.SharedGalleryImageVersionsOperations
65+
:ivar community_galleries: CommunityGalleriesOperations operations
66+
:vartype community_galleries:
67+
azure.mgmt.compute.v2023_07_03.operations.CommunityGalleriesOperations
68+
:ivar community_gallery_images: CommunityGalleryImagesOperations operations
69+
:vartype community_gallery_images:
70+
azure.mgmt.compute.v2023_07_03.operations.CommunityGalleryImagesOperations
71+
:ivar community_gallery_image_versions: CommunityGalleryImageVersionsOperations operations
72+
:vartype community_gallery_image_versions:
73+
azure.mgmt.compute.v2023_07_03.operations.CommunityGalleryImageVersionsOperations
74+
:param credential: Credential needed for the client to connect to Azure. Required.
75+
:type credential: ~azure.core.credentials.TokenCredential
76+
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure
77+
subscription. The subscription ID forms part of the URI for every service call. Required.
78+
:type subscription_id: str
79+
:param base_url: Service URL. Default value is "https://management.azure.com".
80+
:type base_url: str
81+
:keyword api_version: Api Version. Default value is "2023-07-03". Note that overriding this
82+
default value may result in unsupported behavior.
83+
:paramtype api_version: str
84+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
85+
Retry-After header is present.
86+
"""
87+
88+
def __init__(
89+
self,
90+
credential: "TokenCredential",
91+
subscription_id: str,
92+
base_url: str = "https://management.azure.com",
93+
**kwargs: Any
94+
) -> None:
95+
self._config = ComputeManagementClientConfiguration(
96+
credential=credential, subscription_id=subscription_id, **kwargs
97+
)
98+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
99+
100+
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
101+
self._serialize = Serializer(client_models)
102+
self._deserialize = Deserializer(client_models)
103+
self._serialize.client_side_validation = False
104+
self.galleries = GalleriesOperations(
105+
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
106+
)
107+
self.gallery_images = GalleryImagesOperations(
108+
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
109+
)
110+
self.gallery_image_versions = GalleryImageVersionsOperations(
111+
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
112+
)
113+
self.gallery_applications = GalleryApplicationsOperations(
114+
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
115+
)
116+
self.gallery_application_versions = GalleryApplicationVersionsOperations(
117+
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
118+
)
119+
self.gallery_sharing_profile = GallerySharingProfileOperations(
120+
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
121+
)
122+
self.shared_galleries = SharedGalleriesOperations(
123+
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
124+
)
125+
self.shared_gallery_images = SharedGalleryImagesOperations(
126+
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
127+
)
128+
self.shared_gallery_image_versions = SharedGalleryImageVersionsOperations(
129+
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
130+
)
131+
self.community_galleries = CommunityGalleriesOperations(
132+
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
133+
)
134+
self.community_gallery_images = CommunityGalleryImagesOperations(
135+
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
136+
)
137+
self.community_gallery_image_versions = CommunityGalleryImageVersionsOperations(
138+
self._client, self._config, self._serialize, self._deserialize, "2023-07-03"
139+
)
140+
141+
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
142+
"""Runs the network request through the client's chained policies.
143+
144+
>>> from azure.core.rest import HttpRequest
145+
>>> request = HttpRequest("GET", "https://www.example.org/")
146+
<HttpRequest [GET], url: 'https://www.example.org/'>
147+
>>> response = client._send_request(request)
148+
<HttpResponse: 200 OK>
149+
150+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
151+
152+
:param request: The network request you want to make. Required.
153+
:type request: ~azure.core.rest.HttpRequest
154+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
155+
:return: The response of your network call. Does not do error handling on your response.
156+
:rtype: ~azure.core.rest.HttpResponse
157+
"""
158+
159+
request_copy = deepcopy(request)
160+
request_copy.url = self._client.format_url(request_copy.url)
161+
return self._client.send_request(request_copy, **kwargs)
162+
163+
def close(self) -> None:
164+
self._client.close()
165+
166+
def __enter__(self) -> "ComputeManagementClient":
167+
self._client.__enter__()
168+
return self
169+
170+
def __exit__(self, *exc_details: Any) -> None:
171+
self._client.__exit__(*exc_details)
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from typing import Any, TYPE_CHECKING
10+
11+
from azure.core.configuration import Configuration
12+
from azure.core.pipeline import policies
13+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
14+
15+
from ._version import VERSION
16+
17+
if TYPE_CHECKING:
18+
# pylint: disable=unused-import,ungrouped-imports
19+
from azure.core.credentials import TokenCredential
20+
21+
22+
class ComputeManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
23+
"""Configuration for ComputeManagementClient.
24+
25+
Note that all parameters used to create this instance are saved as instance
26+
attributes.
27+
28+
:param credential: Credential needed for the client to connect to Azure. Required.
29+
:type credential: ~azure.core.credentials.TokenCredential
30+
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure
31+
subscription. The subscription ID forms part of the URI for every service call. Required.
32+
:type subscription_id: str
33+
:keyword api_version: Api Version. Default value is "2023-07-03". Note that overriding this
34+
default value may result in unsupported behavior.
35+
:paramtype api_version: str
36+
"""
37+
38+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
39+
super(ComputeManagementClientConfiguration, self).__init__(**kwargs)
40+
api_version: str = kwargs.pop("api_version", "2023-07-03")
41+
42+
if credential is None:
43+
raise ValueError("Parameter 'credential' must not be None.")
44+
if subscription_id is None:
45+
raise ValueError("Parameter 'subscription_id' must not be None.")
46+
47+
self.credential = credential
48+
self.subscription_id = subscription_id
49+
self.api_version = api_version
50+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
51+
kwargs.setdefault("sdk_moniker", "mgmt-compute/{}".format(VERSION))
52+
self._configure(**kwargs)
53+
54+
def _configure(self, **kwargs: Any) -> None:
55+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
56+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
57+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
58+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
59+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
60+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
61+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
62+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
63+
self.authentication_policy = kwargs.get("authentication_policy")
64+
if self.credential and not self.authentication_policy:
65+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
66+
self.credential, *self.credential_scopes, **kwargs
67+
)

0 commit comments

Comments
 (0)