|
1 | 1 | # coding=utf-8
|
2 | 2 | # --------------------------------------------------------------------------
|
3 | 3 | # Copyright (c) Microsoft Corporation. All rights reserved.
|
4 |
| -# Licensed under the MIT License. See License.txt in the project root for |
5 |
| -# license information. |
6 |
| -# |
| 4 | +# Licensed under the MIT License. See License.txt in the project root for license information. |
7 | 5 | # Code generated by Microsoft (R) AutoRest Code Generator.
|
8 |
| -# Changes may cause incorrect behavior and will be lost if the code is |
9 |
| -# regenerated. |
| 6 | +# Changes may cause incorrect behavior and will be lost if the code is regenerated. |
10 | 7 | # --------------------------------------------------------------------------
|
11 | 8 |
|
12 |
| -from msrest.service_client import SDKClient |
13 |
| -from msrest import Serializer, Deserializer |
| 9 | +from typing import TYPE_CHECKING |
| 10 | + |
| 11 | +from azure.mgmt.core import ARMPipelineClient |
| 12 | +from msrest import Deserializer, Serializer |
| 13 | + |
| 14 | +if TYPE_CHECKING: |
| 15 | + # pylint: disable=unused-import,ungrouped-imports |
| 16 | + from typing import Any, Optional |
| 17 | + |
| 18 | + from azure.core.credentials import TokenCredential |
14 | 19 |
|
15 | 20 | from ._configuration import ServiceFabricManagementClientConfiguration
|
16 | 21 | from .operations import ClustersOperations
|
|
20 | 25 | from .operations import ApplicationTypeVersionsOperations
|
21 | 26 | from .operations import ApplicationsOperations
|
22 | 27 | from .operations import ServicesOperations
|
| 28 | +from .operations import ManagedClustersOperations |
| 29 | +from .operations import ManagedClusterVersionsOperations |
| 30 | +from .operations import NodeTypesOperations |
23 | 31 | from . import models
|
24 | 32 |
|
25 | 33 |
|
26 |
| -class ServiceFabricManagementClient(SDKClient): |
27 |
| - """Service Fabric Management Client |
| 34 | +class ServiceFabricManagementClient(object): |
| 35 | + """Service Fabric Management Client. |
28 | 36 |
|
29 |
| - :ivar config: Configuration for client. |
30 |
| - :vartype config: ServiceFabricManagementClientConfiguration |
31 |
| -
|
32 |
| - :ivar clusters: Clusters operations |
| 37 | + :ivar clusters: ClustersOperations operations |
33 | 38 | :vartype clusters: azure.mgmt.servicefabric.operations.ClustersOperations
|
34 |
| - :ivar cluster_versions: ClusterVersions operations |
| 39 | + :ivar cluster_versions: ClusterVersionsOperations operations |
35 | 40 | :vartype cluster_versions: azure.mgmt.servicefabric.operations.ClusterVersionsOperations
|
36 | 41 | :ivar operations: Operations operations
|
37 | 42 | :vartype operations: azure.mgmt.servicefabric.operations.Operations
|
38 |
| - :ivar application_types: ApplicationTypes operations |
| 43 | + :ivar application_types: ApplicationTypesOperations operations |
39 | 44 | :vartype application_types: azure.mgmt.servicefabric.operations.ApplicationTypesOperations
|
40 |
| - :ivar application_type_versions: ApplicationTypeVersions operations |
| 45 | + :ivar application_type_versions: ApplicationTypeVersionsOperations operations |
41 | 46 | :vartype application_type_versions: azure.mgmt.servicefabric.operations.ApplicationTypeVersionsOperations
|
42 |
| - :ivar applications: Applications operations |
| 47 | + :ivar applications: ApplicationsOperations operations |
43 | 48 | :vartype applications: azure.mgmt.servicefabric.operations.ApplicationsOperations
|
44 |
| - :ivar services: Services operations |
| 49 | + :ivar services: ServicesOperations operations |
45 | 50 | :vartype services: azure.mgmt.servicefabric.operations.ServicesOperations
|
46 |
| -
|
47 |
| - :param credentials: Credentials needed for the client to connect to Azure. |
48 |
| - :type credentials: :mod:`A msrestazure Credentials |
49 |
| - object<msrestazure.azure_active_directory>` |
| 51 | + :ivar managed_clusters: ManagedClustersOperations operations |
| 52 | + :vartype managed_clusters: azure.mgmt.servicefabric.operations.ManagedClustersOperations |
| 53 | + :ivar managed_cluster_versions: ManagedClusterVersionsOperations operations |
| 54 | + :vartype managed_cluster_versions: azure.mgmt.servicefabric.operations.ManagedClusterVersionsOperations |
| 55 | + :ivar node_types: NodeTypesOperations operations |
| 56 | + :vartype node_types: azure.mgmt.servicefabric.operations.NodeTypesOperations |
| 57 | + :param credential: Credential needed for the client to connect to Azure. |
| 58 | + :type credential: ~azure.core.credentials.TokenCredential |
50 | 59 | :param subscription_id: The customer subscription identifier.
|
51 | 60 | :type subscription_id: str
|
52 | 61 | :param str base_url: Service URL
|
| 62 | + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. |
53 | 63 | """
|
54 | 64 |
|
55 | 65 | def __init__(
|
56 |
| - self, credentials, subscription_id, base_url=None): |
57 |
| - |
58 |
| - self.config = ServiceFabricManagementClientConfiguration(credentials, subscription_id, base_url) |
59 |
| - super(ServiceFabricManagementClient, self).__init__(self.config.credentials, self.config) |
| 66 | + self, |
| 67 | + credential, # type: "TokenCredential" |
| 68 | + subscription_id, # type: str |
| 69 | + base_url=None, # type: Optional[str] |
| 70 | + **kwargs # type: Any |
| 71 | + ): |
| 72 | + # type: (...) -> None |
| 73 | + if not base_url: |
| 74 | + base_url = 'https://management.azure.com' |
| 75 | + self._config = ServiceFabricManagementClientConfiguration(credential, subscription_id, **kwargs) |
| 76 | + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) |
60 | 77 |
|
61 | 78 | client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
|
62 |
| - self.api_version = '2019-03-01' |
63 | 79 | self._serialize = Serializer(client_models)
|
| 80 | + self._serialize.client_side_validation = False |
64 | 81 | self._deserialize = Deserializer(client_models)
|
65 | 82 |
|
66 | 83 | self.clusters = ClustersOperations(
|
67 |
| - self._client, self.config, self._serialize, self._deserialize) |
| 84 | + self._client, self._config, self._serialize, self._deserialize) |
68 | 85 | self.cluster_versions = ClusterVersionsOperations(
|
69 |
| - self._client, self.config, self._serialize, self._deserialize) |
| 86 | + self._client, self._config, self._serialize, self._deserialize) |
70 | 87 | self.operations = Operations(
|
71 |
| - self._client, self.config, self._serialize, self._deserialize) |
| 88 | + self._client, self._config, self._serialize, self._deserialize) |
72 | 89 | self.application_types = ApplicationTypesOperations(
|
73 |
| - self._client, self.config, self._serialize, self._deserialize) |
| 90 | + self._client, self._config, self._serialize, self._deserialize) |
74 | 91 | self.application_type_versions = ApplicationTypeVersionsOperations(
|
75 |
| - self._client, self.config, self._serialize, self._deserialize) |
| 92 | + self._client, self._config, self._serialize, self._deserialize) |
76 | 93 | self.applications = ApplicationsOperations(
|
77 |
| - self._client, self.config, self._serialize, self._deserialize) |
| 94 | + self._client, self._config, self._serialize, self._deserialize) |
78 | 95 | self.services = ServicesOperations(
|
79 |
| - self._client, self.config, self._serialize, self._deserialize) |
| 96 | + self._client, self._config, self._serialize, self._deserialize) |
| 97 | + self.managed_clusters = ManagedClustersOperations( |
| 98 | + self._client, self._config, self._serialize, self._deserialize) |
| 99 | + self.managed_cluster_versions = ManagedClusterVersionsOperations( |
| 100 | + self._client, self._config, self._serialize, self._deserialize) |
| 101 | + self.node_types = NodeTypesOperations( |
| 102 | + self._client, self._config, self._serialize, self._deserialize) |
| 103 | + |
| 104 | + def close(self): |
| 105 | + # type: () -> None |
| 106 | + self._client.close() |
| 107 | + |
| 108 | + def __enter__(self): |
| 109 | + # type: () -> ServiceFabricManagementClient |
| 110 | + self._client.__enter__() |
| 111 | + return self |
| 112 | + |
| 113 | + def __exit__(self, *exc_details): |
| 114 | + # type: (Any) -> None |
| 115 | + self._client.__exit__(*exc_details) |
0 commit comments