Skip to content

Commit ab95bc2

Browse files
committed
add vendored_sdks
1 parent f5e448a commit ab95bc2

Some content is hidden

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

44 files changed

+32294
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
# pylint: disable=wrong-import-position
9+
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._container_service_client import ContainerServiceClient # type: ignore
16+
from ._version import VERSION
17+
18+
__version__ = VERSION
19+
20+
try:
21+
from ._patch import __all__ as _patch_all
22+
from ._patch import *
23+
except ImportError:
24+
_patch_all = []
25+
from ._patch import patch_sdk as _patch_sdk
26+
27+
__all__ = [
28+
"ContainerServiceClient",
29+
]
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
31+
32+
_patch_sdk()
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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, Optional, TYPE_CHECKING
10+
11+
from azure.core.pipeline import policies
12+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
13+
14+
from ._version import VERSION
15+
16+
if TYPE_CHECKING:
17+
from azure.core import AzureClouds
18+
from azure.core.credentials import TokenCredential
19+
20+
21+
class ContainerServiceClientConfiguration: # pylint: disable=too-many-instance-attributes
22+
"""Configuration for ContainerServiceClient.
23+
24+
Note that all parameters used to create this instance are saved as instance
25+
attributes.
26+
27+
:param credential: Credential needed for the client to connect to Azure. Required.
28+
:type credential: ~azure.core.credentials.TokenCredential
29+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
30+
:type subscription_id: str
31+
:param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
32+
None.
33+
:type cloud_setting: ~azure.core.AzureClouds
34+
:keyword api_version: Api Version. Default value is "2025-10-01". Note that overriding this
35+
default value may result in unsupported behavior.
36+
:paramtype api_version: str
37+
"""
38+
39+
def __init__(
40+
self,
41+
credential: "TokenCredential",
42+
subscription_id: str,
43+
cloud_setting: Optional["AzureClouds"] = None,
44+
**kwargs: Any
45+
) -> None:
46+
api_version: str = kwargs.pop("api_version", "2025-10-01")
47+
48+
if credential is None:
49+
raise ValueError("Parameter 'credential' must not be None.")
50+
if subscription_id is None:
51+
raise ValueError("Parameter 'subscription_id' must not be None.")
52+
53+
self.credential = credential
54+
self.subscription_id = subscription_id
55+
self.cloud_setting = cloud_setting
56+
self.api_version = api_version
57+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
58+
kwargs.setdefault("sdk_moniker", "mgmt-containerservice/{}".format(VERSION))
59+
self.polling_interval = kwargs.get("polling_interval", 30)
60+
self._configure(**kwargs)
61+
62+
def _configure(self, **kwargs: Any) -> None:
63+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
64+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
65+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
66+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
67+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
68+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
69+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
70+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
71+
self.authentication_policy = kwargs.get("authentication_policy")
72+
if self.credential and not self.authentication_policy:
73+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
74+
self.credential, *self.credential_scopes, **kwargs
75+
)
Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
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, Optional, TYPE_CHECKING, cast
11+
from typing_extensions import Self
12+
13+
from azure.core.pipeline import policies
14+
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
16+
from azure.mgmt.core import ARMPipelineClient
17+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
19+
20+
from . import models as _models
21+
from ._configuration import ContainerServiceClientConfiguration
22+
from ._utils.serialization import Deserializer, Serializer
23+
from .operations import (
24+
AgentPoolsOperations,
25+
MachinesOperations,
26+
MaintenanceConfigurationsOperations,
27+
ManagedClustersOperations,
28+
ManagedNamespacesOperations,
29+
Operations,
30+
PrivateEndpointConnectionsOperations,
31+
PrivateLinkResourcesOperations,
32+
ResolvePrivateLinkServiceIdOperations,
33+
SnapshotsOperations,
34+
TrustedAccessRoleBindingsOperations,
35+
TrustedAccessRolesOperations,
36+
)
37+
38+
if TYPE_CHECKING:
39+
from azure.core import AzureClouds
40+
from azure.core.credentials import TokenCredential
41+
42+
43+
class ContainerServiceClient: # pylint: disable=too-many-instance-attributes
44+
"""The Container Service Client.
45+
46+
:ivar operations: Operations operations
47+
:vartype operations: azure.mgmt.containerservice.operations.Operations
48+
:ivar managed_clusters: ManagedClustersOperations operations
49+
:vartype managed_clusters: azure.mgmt.containerservice.operations.ManagedClustersOperations
50+
:ivar maintenance_configurations: MaintenanceConfigurationsOperations operations
51+
:vartype maintenance_configurations:
52+
azure.mgmt.containerservice.operations.MaintenanceConfigurationsOperations
53+
:ivar managed_namespaces: ManagedNamespacesOperations operations
54+
:vartype managed_namespaces: azure.mgmt.containerservice.operations.ManagedNamespacesOperations
55+
:ivar agent_pools: AgentPoolsOperations operations
56+
:vartype agent_pools: azure.mgmt.containerservice.operations.AgentPoolsOperations
57+
:ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
58+
:vartype private_endpoint_connections:
59+
azure.mgmt.containerservice.operations.PrivateEndpointConnectionsOperations
60+
:ivar private_link_resources: PrivateLinkResourcesOperations operations
61+
:vartype private_link_resources:
62+
azure.mgmt.containerservice.operations.PrivateLinkResourcesOperations
63+
:ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations
64+
:vartype resolve_private_link_service_id:
65+
azure.mgmt.containerservice.operations.ResolvePrivateLinkServiceIdOperations
66+
:ivar snapshots: SnapshotsOperations operations
67+
:vartype snapshots: azure.mgmt.containerservice.operations.SnapshotsOperations
68+
:ivar trusted_access_role_bindings: TrustedAccessRoleBindingsOperations operations
69+
:vartype trusted_access_role_bindings:
70+
azure.mgmt.containerservice.operations.TrustedAccessRoleBindingsOperations
71+
:ivar trusted_access_roles: TrustedAccessRolesOperations operations
72+
:vartype trusted_access_roles:
73+
azure.mgmt.containerservice.operations.TrustedAccessRolesOperations
74+
:ivar machines: MachinesOperations operations
75+
:vartype machines: azure.mgmt.containerservice.operations.MachinesOperations
76+
:param credential: Credential needed for the client to connect to Azure. Required.
77+
:type credential: ~azure.core.credentials.TokenCredential
78+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
79+
:type subscription_id: str
80+
:param base_url: Service URL. Default value is None.
81+
:type base_url: str
82+
:keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
83+
None.
84+
:paramtype cloud_setting: ~azure.core.AzureClouds
85+
:keyword api_version: Api Version. Default value is "2025-10-01". Note that overriding this
86+
default value may result in unsupported behavior.
87+
:paramtype api_version: str
88+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
89+
Retry-After header is present.
90+
"""
91+
92+
def __init__(
93+
self,
94+
credential: "TokenCredential",
95+
subscription_id: str,
96+
base_url: Optional[str] = None,
97+
*,
98+
cloud_setting: Optional["AzureClouds"] = None,
99+
**kwargs: Any
100+
) -> None:
101+
_cloud = cloud_setting or settings.current.azure_cloud # type: ignore
102+
_endpoints = get_arm_endpoints(_cloud)
103+
if not base_url:
104+
base_url = _endpoints["resource_manager"]
105+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
106+
self._config = ContainerServiceClientConfiguration(
107+
credential=credential,
108+
subscription_id=subscription_id,
109+
cloud_setting=cloud_setting,
110+
credential_scopes=credential_scopes,
111+
**kwargs
112+
)
113+
114+
_policies = kwargs.pop("policies", None)
115+
if _policies is None:
116+
_policies = [
117+
policies.RequestIdPolicy(**kwargs),
118+
self._config.headers_policy,
119+
self._config.user_agent_policy,
120+
self._config.proxy_policy,
121+
policies.ContentDecodePolicy(**kwargs),
122+
ARMAutoResourceProviderRegistrationPolicy(),
123+
self._config.redirect_policy,
124+
self._config.retry_policy,
125+
self._config.authentication_policy,
126+
self._config.custom_hook_policy,
127+
self._config.logging_policy,
128+
policies.DistributedTracingPolicy(**kwargs),
129+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
130+
self._config.http_logging_policy,
131+
]
132+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
133+
134+
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
135+
self._serialize = Serializer(client_models)
136+
self._deserialize = Deserializer(client_models)
137+
self._serialize.client_side_validation = False
138+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
139+
self.managed_clusters = ManagedClustersOperations(
140+
self._client, self._config, self._serialize, self._deserialize
141+
)
142+
self.maintenance_configurations = MaintenanceConfigurationsOperations(
143+
self._client, self._config, self._serialize, self._deserialize
144+
)
145+
self.managed_namespaces = ManagedNamespacesOperations(
146+
self._client, self._config, self._serialize, self._deserialize
147+
)
148+
self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize)
149+
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
150+
self._client, self._config, self._serialize, self._deserialize
151+
)
152+
self.private_link_resources = PrivateLinkResourcesOperations(
153+
self._client, self._config, self._serialize, self._deserialize
154+
)
155+
self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(
156+
self._client, self._config, self._serialize, self._deserialize
157+
)
158+
self.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize)
159+
self.trusted_access_role_bindings = TrustedAccessRoleBindingsOperations(
160+
self._client, self._config, self._serialize, self._deserialize
161+
)
162+
self.trusted_access_roles = TrustedAccessRolesOperations(
163+
self._client, self._config, self._serialize, self._deserialize
164+
)
165+
self.machines = MachinesOperations(self._client, self._config, self._serialize, self._deserialize)
166+
167+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
168+
"""Runs the network request through the client's chained policies.
169+
170+
>>> from azure.core.rest import HttpRequest
171+
>>> request = HttpRequest("GET", "https://www.example.org/")
172+
<HttpRequest [GET], url: 'https://www.example.org/'>
173+
>>> response = client._send_request(request)
174+
<HttpResponse: 200 OK>
175+
176+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
177+
178+
:param request: The network request you want to make. Required.
179+
:type request: ~azure.core.rest.HttpRequest
180+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
181+
:return: The response of your network call. Does not do error handling on your response.
182+
:rtype: ~azure.core.rest.HttpResponse
183+
"""
184+
185+
request_copy = deepcopy(request)
186+
request_copy.url = self._client.format_url(request_copy.url)
187+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
188+
189+
def close(self) -> None:
190+
self._client.close()
191+
192+
def __enter__(self) -> Self:
193+
self._client.__enter__()
194+
return self
195+
196+
def __exit__(self, *exc_details: Any) -> None:
197+
self._client.__exit__(*exc_details)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
# --------------------------------------------------------------------------
6+
"""Customize generated code here.
7+
8+
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
9+
"""
10+
from typing import List
11+
12+
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
13+
14+
15+
def patch_sdk():
16+
"""Do not remove from this file.
17+
18+
`patch_sdk` is a last resort escape hatch that allows you to do customizations
19+
you can't accomplish using the techniques described in
20+
https://aka.ms/azsdk/python/dpcodegen/python/customize
21+
"""
Lines changed: 6 additions & 0 deletions
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)