Skip to content

Commit

Permalink
CodeGen from PR 30568 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge a7db06064173819a1fa981f90e78fd38df7eab2d into b4e2402f686dda5237ed140897d49624e6d2a462
  • Loading branch information
SDKAuto committed Sep 30, 2024
1 parent c771ec1 commit 3e7f0aa
Show file tree
Hide file tree
Showing 34 changed files with 10,943 additions and 20,358 deletions.
11 changes: 9 additions & 2 deletions sdk/computefleet/azure-mgmt-computefleet/_meta.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"commit": "c1cea38fb7e5cec9afe223a2ed15cbe2fbeecbdb",
"commit": "c9e86b09add417bb10ac8d880c5b8d69dae12201",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"typespec_src": "specification/azurefleet/AzureFleet.Management",
"@azure-tools/typespec-python": "0.26.0"
"@azure-tools/typespec-python": "0.26.0",
"autorest": "3.10.2",
"use": [
"@autorest/[email protected]",
"@autorest/[email protected]"
],
"autorest_command": "autorest specification/azurefleet/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/[email protected] --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
"readme": "specification/azurefleet/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# --------------------------------------------------------------------------
# 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) Python Code Generator.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._client import ComputeFleetMgmtClient
from ._microsoft_azure_fleet import MicrosoftAzureFleet
from ._version import VERSION

__version__ = VERSION
Expand All @@ -19,7 +19,7 @@
from ._patch import patch_sdk as _patch_sdk

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# --------------------------------------------------------------------------
# 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) Python Code Generator.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand All @@ -18,24 +18,23 @@
from azure.core.credentials import TokenCredential


class ComputeFleetMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
"""Configuration for ComputeFleetMgmtClient.
class MicrosoftAzureFleetConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
"""Configuration for MicrosoftAzureFleet.
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential used to authenticate requests to the service. Required.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:keyword api_version: The API version to use for this operation. Default value is
"2024-05-01-preview". Note that overriding this default value may result in unsupported
behavior.
:keyword api_version: Api Version. Default value is "2024-11-01". 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-01-preview")
api_version: str = kwargs.pop("api_version", "2024-11-01")

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 @@ -2,7 +2,7 @@
# --------------------------------------------------------------------------
# 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) Python Code Generator.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand All @@ -15,7 +15,8 @@
from azure.mgmt.core import ARMPipelineClient
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy

from ._configuration import ComputeFleetMgmtClientConfiguration
from . import models as _models
from ._configuration import MicrosoftAzureFleetConfiguration
from ._serialization import Deserializer, Serializer
from .operations import FleetsOperations, Operations

Expand All @@ -24,22 +25,21 @@
from azure.core.credentials import TokenCredential


class ComputeFleetMgmtClient: # pylint: disable=client-accepts-api-version-keyword
"""ComputeFleetMgmtClient.
class MicrosoftAzureFleet: # pylint: disable=client-accepts-api-version-keyword
"""MicrosoftAzureFleet.
:ivar operations: Operations operations
:vartype operations: azure.mgmt.computefleet.operations.Operations
:ivar fleets: FleetsOperations operations
:vartype fleets: azure.mgmt.computefleet.operations.FleetsOperations
:param credential: Credential used to authenticate requests to the service. Required.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param base_url: Service host. Default value is "https://management.azure.com".
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: The API version to use for this operation. Default value is
"2024-05-01-preview". Note that overriding this default value may result in unsupported
behavior.
:keyword api_version: Api Version. Default value is "2024-11-01". 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.
Expand All @@ -52,7 +52,7 @@ def __init__(
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
self._config = ComputeFleetMgmtClientConfiguration(
self._config = MicrosoftAzureFleetConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
_policies = kwargs.pop("policies", None)
Expand All @@ -75,19 +75,20 @@ def __init__(
]
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)

self._serialize = Serializer()
self._deserialize = Deserializer()
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.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.fleets = FleetsOperations(self._client, self._config, self._serialize, self._deserialize)

def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
def _send_request(self, request: HttpRequest, *, stream: bool = False, **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)
>>> response = client._send_request(request)
<HttpResponse: 200 OK>
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
Expand Down
Loading

0 comments on commit 3e7f0aa

Please sign in to comment.