Skip to content

Commit

Permalink
CodeGen from PR 30592 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 15bd5dc673324266703645910f066701171de4f4 into 4cb5b94f8c1da3d1bcd56cde3fa62dfd5493e345
  • Loading branch information
SDKAuto committed Sep 30, 2024
1 parent 54b2d37 commit e4d380f
Show file tree
Hide file tree
Showing 131 changed files with 4,064 additions and 535 deletions.
6 changes: 3 additions & 3 deletions sdk/hybridcompute/azure-mgmt-hybridcompute/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "b574e2a41acda14a90ef237006e8bbdda2b63c63",
"commit": "21da7cf8cc8edb9465696f5198563d97df18537f",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.10.2",
"use": [
"@autorest/python@6.15.0",
"@autorest/python@6.19.0",
"@autorest/modelerfour@4.27.0"
],
"autorest_command": "autorest specification/hybridcompute/resource-manager/readme.md --generate-sample=True --generate-test=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.15.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
"autorest_command": "autorest specification/hybridcompute/resource-manager/readme.md --generate-sample=True --generate-test=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.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
"readme": "specification/hybridcompute/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ class HybridComputeManagementClientConfiguration: # pylint: disable=too-many-in
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2024-05-20-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2024-09-10-preview". 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:
api_version: str = kwargs.pop("api_version", "2024-05-20-preview")
api_version: str = kwargs.pop("api_version", "2024-09-10-preview")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
ExtensionMetadataOperations,
GatewaysOperations,
HybridComputeManagementClientOperationsMixin,
LicenseProfilesOperations,
LicensesOperations,
MachineExtensionsOperations,
MachineRunCommandsOperations,
Expand Down Expand Up @@ -49,6 +50,8 @@ class HybridComputeManagementClient(
:vartype licenses: azure.mgmt.hybridcompute.operations.LicensesOperations
:ivar machines: MachinesOperations operations
:vartype machines: azure.mgmt.hybridcompute.operations.MachinesOperations
:ivar license_profiles: LicenseProfilesOperations operations
:vartype license_profiles: azure.mgmt.hybridcompute.operations.LicenseProfilesOperations
:ivar machine_extensions: MachineExtensionsOperations operations
:vartype machine_extensions: azure.mgmt.hybridcompute.operations.MachineExtensionsOperations
:ivar extension_metadata: ExtensionMetadataOperations operations
Expand Down Expand Up @@ -81,7 +84,7 @@ class HybridComputeManagementClient(
: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 "2024-05-20-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2024-09-10-preview". 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 Down Expand Up @@ -124,6 +127,9 @@ def __init__(
self._serialize.client_side_validation = False
self.licenses = LicensesOperations(self._client, self._config, self._serialize, self._deserialize)
self.machines = MachinesOperations(self._client, self._config, self._serialize, self._deserialize)
self.license_profiles = LicenseProfilesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.machine_extensions = MachineExtensionsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand Down
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 = "9.0.0b4"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ class HybridComputeManagementClientConfiguration: # pylint: disable=too-many-in
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2024-05-20-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2024-09-10-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
api_version: str = kwargs.pop("api_version", "2024-05-20-preview")
api_version: str = kwargs.pop("api_version", "2024-09-10-preview")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
ExtensionMetadataOperations,
GatewaysOperations,
HybridComputeManagementClientOperationsMixin,
LicenseProfilesOperations,
LicensesOperations,
MachineExtensionsOperations,
MachineRunCommandsOperations,
Expand Down Expand Up @@ -49,6 +50,8 @@ class HybridComputeManagementClient(
:vartype licenses: azure.mgmt.hybridcompute.aio.operations.LicensesOperations
:ivar machines: MachinesOperations operations
:vartype machines: azure.mgmt.hybridcompute.aio.operations.MachinesOperations
:ivar license_profiles: LicenseProfilesOperations operations
:vartype license_profiles: azure.mgmt.hybridcompute.aio.operations.LicenseProfilesOperations
:ivar machine_extensions: MachineExtensionsOperations operations
:vartype machine_extensions:
azure.mgmt.hybridcompute.aio.operations.MachineExtensionsOperations
Expand Down Expand Up @@ -85,7 +88,7 @@ class HybridComputeManagementClient(
: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 "2024-05-20-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2024-09-10-preview". 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 Down Expand Up @@ -128,6 +131,9 @@ def __init__(
self._serialize.client_side_validation = False
self.licenses = LicensesOperations(self._client, self._config, self._serialize, self._deserialize)
self.machines = MachinesOperations(self._client, self._config, self._serialize, self._deserialize)
self.license_profiles = LicenseProfilesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.machine_extensions = MachineExtensionsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from ._licenses_operations import LicensesOperations
from ._machines_operations import MachinesOperations
from ._license_profiles_operations import LicenseProfilesOperations
from ._machine_extensions_operations import MachineExtensionsOperations
from ._hybrid_compute_management_client_operations import HybridComputeManagementClientOperationsMixin
from ._extension_metadata_operations import ExtensionMetadataOperations
Expand All @@ -28,6 +29,7 @@
__all__ = [
"LicensesOperations",
"MachinesOperations",
"LicenseProfilesOperations",
"MachineExtensionsOperations",
"HybridComputeManagementClientOperationsMixin",
"ExtensionMetadataOperations",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

from ... import models as _models
from ...operations._extension_metadata_operations import build_get_request, build_list_request
from .._vendor import HybridComputeManagementClientMixinABC

if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
StreamClosedError,
StreamConsumedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
Expand All @@ -38,7 +40,6 @@
build_list_by_subscription_request,
build_update_request,
)
from .._vendor import HybridComputeManagementClientMixinABC

if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
Expand Down Expand Up @@ -106,6 +107,7 @@ async def _create_or_update_initial(
)
_request.url = self._client.format_url(_request.url)

_decompress = kwargs.pop("decompress", True)
_stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
Expand All @@ -114,23 +116,23 @@ async def _create_or_update_initial(
response = pipeline_response.http_response

if response.status_code not in [200, 201]:
await response.read() # Load the body in memory and close the socket
try:
await response.read() # Load the body in memory and close the socket
except (StreamConsumedError, StreamClosedError):
pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

response_headers = {}
if response.status_code == 200:
deserialized = response.stream_download(self._client._pipeline)

if response.status_code == 201:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
response_headers["Azure-AsyncOperation"] = self._deserialize(
"str", response.headers.get("Azure-AsyncOperation")
)

deserialized = response.stream_download(self._client._pipeline)
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)

if cls:
return cls(pipeline_response, deserialized, response_headers) # type: ignore
Expand Down Expand Up @@ -471,6 +473,7 @@ async def _delete_initial(self, resource_group_name: str, gateway_name: str, **k
)
_request.url = self._client.format_url(_request.url)

_decompress = kwargs.pop("decompress", True)
_stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
Expand All @@ -479,7 +482,10 @@ async def _delete_initial(self, resource_group_name: str, gateway_name: str, **k
response = pipeline_response.http_response

if response.status_code not in [202, 204]:
await response.read() # Load the body in memory and close the socket
try:
await response.read() # Load the body in memory and close the socket
except (StreamConsumedError, StreamClosedError):
pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
Expand All @@ -492,10 +498,7 @@ async def _delete_initial(self, resource_group_name: str, gateway_name: str, **k
"str", response.headers.get("Azure-AsyncOperation")
)

deserialized = response.stream_download(self._client._pipeline)

if response.status_code == 204:
deserialized = response.stream_download(self._client._pipeline)
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)

if cls:
return cls(pipeline_response, deserialized, response_headers) # type: ignore
Expand Down
Loading

0 comments on commit e4d380f

Please sign in to comment.