Skip to content

Commit 0b9fe38

Browse files
author
SDKAuto
committed
CodeGen from PR 3536 in test-repo-billy/azure-rest-api-specs
Merge f568df0c21e46453a553de14124dd0918d28533c into 6c6e1713f03acaf37e5c89652b023dd2c9eae16e
1 parent b2b0c35 commit 0b9fe38

33 files changed

+3987
-3704
lines changed
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"commit": "abad0096677005817d2c19df2364663e5583c8fc",
3-
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
2+
"commit": "988d78cda7f7f3af632cdb4ca1c46ec25d4da018",
3+
"repository_url": "https://github.com/test-repo-billy/azure-rest-api-specs",
44
"typespec_src": "specification/mongocluster/DocumentDB.MongoCluster.Management",
5-
"@azure-tools/typespec-python": "0.24.3",
6-
"@autorest/python": "6.14.3"
5+
"@azure-tools/typespec-python": "0.31.1"
76
}

sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_client.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
Operations,
2424
PrivateEndpointConnectionsOperations,
2525
PrivateLinksOperations,
26+
ReplicasOperations,
2627
)
2728

2829
if TYPE_CHECKING:
@@ -45,15 +46,16 @@ class MongoClusterMgmtClient: # pylint: disable=client-accepts-api-version-keyw
4546
azure.mgmt.mongocluster.operations.PrivateEndpointConnectionsOperations
4647
:ivar private_links: PrivateLinksOperations operations
4748
:vartype private_links: azure.mgmt.mongocluster.operations.PrivateLinksOperations
49+
:ivar replicas: ReplicasOperations operations
50+
:vartype replicas: azure.mgmt.mongocluster.operations.ReplicasOperations
4851
:param credential: Credential used to authenticate requests to the service. Required.
4952
:type credential: ~azure.core.credentials.TokenCredential
5053
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
5154
:type subscription_id: str
5255
:param base_url: Service host. Default value is "https://management.azure.com".
5356
:type base_url: str
54-
:keyword api_version: The API version to use for this operation. Default value is
55-
"2024-03-01-preview". Note that overriding this default value may result in unsupported
56-
behavior.
57+
:keyword api_version: The API version to use for this operation. Default value is "2024-07-01".
58+
Note that overriding this default value may result in unsupported behavior.
5759
:paramtype api_version: str
5860
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
5961
Retry-After header is present.
@@ -66,8 +68,9 @@ def __init__(
6668
base_url: str = "https://management.azure.com",
6769
**kwargs: Any
6870
) -> None:
71+
_endpoint = "{endpoint}"
6972
self._config = MongoClusterMgmtClientConfiguration(
70-
credential=credential, subscription_id=subscription_id, **kwargs
73+
credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs
7174
)
7275
_policies = kwargs.pop("policies", None)
7376
if _policies is None:
@@ -87,7 +90,7 @@ def __init__(
8790
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
8891
self._config.http_logging_policy,
8992
]
90-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
93+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
9194

9295
self._serialize = Serializer()
9396
self._deserialize = Deserializer()
@@ -99,6 +102,7 @@ def __init__(
99102
self._client, self._config, self._serialize, self._deserialize
100103
)
101104
self.private_links = PrivateLinksOperations(self._client, self._config, self._serialize, self._deserialize)
105+
self.replicas = ReplicasOperations(self._client, self._config, self._serialize, self._deserialize)
102106

103107
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
104108
"""Runs the network request through the client's chained policies.
@@ -119,7 +123,11 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
119123
"""
120124

121125
request_copy = deepcopy(request)
122-
request_copy.url = self._client.format_url(request_copy.url)
126+
path_format_arguments = {
127+
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
128+
}
129+
130+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
123131
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
124132

125133
def close(self) -> None:

sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_configuration.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,21 @@ class MongoClusterMgmtClientConfiguration: # pylint: disable=too-many-instance-
2828
:type credential: ~azure.core.credentials.TokenCredential
2929
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3030
:type subscription_id: str
31-
:keyword api_version: The API version to use for this operation. Default value is
32-
"2024-03-01-preview". Note that overriding this default value may result in unsupported
33-
behavior.
31+
:param base_url: Service host. Default value is "https://management.azure.com".
32+
:type base_url: str
33+
:keyword api_version: The API version to use for this operation. Default value is "2024-07-01".
34+
Note that overriding this default value may result in unsupported behavior.
3435
:paramtype api_version: str
3536
"""
3637

37-
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
38-
api_version: str = kwargs.pop("api_version", "2024-03-01-preview")
38+
def __init__(
39+
self,
40+
credential: "TokenCredential",
41+
subscription_id: str,
42+
base_url: str = "https://management.azure.com",
43+
**kwargs: Any
44+
) -> None:
45+
api_version: str = kwargs.pop("api_version", "2024-07-01")
3946

4047
if credential is None:
4148
raise ValueError("Parameter 'credential' must not be None.")
@@ -44,6 +51,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4451

4552
self.credential = credential
4653
self.subscription_id = subscription_id
54+
self.base_url = base_url
4755
self.api_version = api_version
4856
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4957
kwargs.setdefault("sdk_moniker", "mgmt-mongocluster/{}".format(VERSION))

0 commit comments

Comments
 (0)