Skip to content

Commit d8d80fa

Browse files
author
SDKAuto
committed
CodeGen from PR 34442 in Azure/azure-rest-api-specs
Merge 935ebe3ffdef6a065d6c5e59615290b52e7d6a38 into ebabd96a91be0af107cc66f3149b0b41d7d44a8f
1 parent 803cfcf commit d8d80fa

40 files changed

+264
-324
lines changed

sdk/nginx/azure-mgmt-nginx/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Nginx Management Client Library.
4-
This package has been tested with Python 3.8+.
4+
This package has been tested with Python 3.9+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.8+ is required to use this package.
15+
- Python 3.9+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
@@ -24,7 +24,7 @@ pip install azure-identity
2424

2525
### Authentication
2626

27-
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
2828

2929
- `AZURE_CLIENT_ID` for Azure client ID.
3030
- `AZURE_TENANT_ID` for Azure tenant ID.

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "198ffdb2b788b49be283a388ad9735b0cfad1be1",
2+
"commit": "1b1bb2a7e574ec29e988d5e4625c76f32c52da6d",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.27.4",
6+
"@autorest/python@6.34.1",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/nginx/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/azure-sdk-for-python/sdk --use=@autorest/python@6.27.4 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/nginx/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.34.1 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/nginx/resource-manager/readme.md"
1111
}

sdk/nginx/azure-mgmt-nginx/azure/mgmt/nginx/_nginx_management_client.py

+14-10
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,19 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10-
from typing import Any, TYPE_CHECKING
10+
from typing import Any, Optional, TYPE_CHECKING, cast
1111
from typing_extensions import Self
1212

1313
from azure.core.pipeline import policies
1414
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
1516
from azure.mgmt.core import ARMPipelineClient
1617
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
1719

1820
from . import models as _models
1921
from ._configuration import NginxManagementClientConfiguration
20-
from ._serialization import Deserializer, Serializer
22+
from ._utils.serialization import Deserializer, Serializer
2123
from .operations import (
2224
ApiKeysOperations,
2325
CertificatesOperations,
@@ -47,7 +49,7 @@ class NginxManagementClient:
4749
:type credential: ~azure.core.credentials.TokenCredential
4850
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
4951
:type subscription_id: str
50-
:param base_url: Service URL. Default value is "https://management.azure.com".
52+
:param base_url: Service URL. Default value is None.
5153
:type base_url: str
5254
:keyword api_version: Api Version. Default value is "2024-11-01-preview". Note that overriding
5355
this default value may result in unsupported behavior.
@@ -57,15 +59,17 @@ class NginxManagementClient:
5759
"""
5860

5961
def __init__(
60-
self,
61-
credential: "TokenCredential",
62-
subscription_id: str,
63-
base_url: str = "https://management.azure.com",
64-
**kwargs: Any
62+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
6563
) -> None:
64+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
65+
_endpoints = get_arm_endpoints(_cloud)
66+
if not base_url:
67+
base_url = _endpoints["resource_manager"]
68+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
6669
self._config = NginxManagementClientConfiguration(
67-
credential=credential, subscription_id=subscription_id, **kwargs
70+
credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs
6871
)
72+
6973
_policies = kwargs.pop("policies", None)
7074
if _policies is None:
7175
_policies = [
@@ -84,7 +88,7 @@ def __init__(
8488
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
8589
self._config.http_logging_policy,
8690
]
87-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
91+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
8892

8993
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
9094
self._serialize = Serializer(client_models)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
6+
# --------------------------------------------------------------------------

0 commit comments

Comments
 (0)