22# --------------------------------------------------------------------------
33# Copyright (c) Microsoft Corporation. All rights reserved.
44# Licensed under the MIT License. See License.txt in the project root for license information.
5- # Code generated by Microsoft (R) AutoRest Code Generator.
5+ # Code generated by Microsoft (R) Python Code Generator.
66# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77# --------------------------------------------------------------------------
88
99from copy import deepcopy
1010from typing import Any , TYPE_CHECKING
11+ from typing_extensions import Self
1112
1213from azure .core .pipeline import policies
1314from azure .core .rest import HttpRequest , HttpResponse
1415from azure .mgmt .core import ARMPipelineClient
1516from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
1617
17- from . import models as _models
1818from ._configuration import DeviceRegistryMgmtClientConfiguration
1919from ._serialization import Deserializer , Serializer
20- from .operations import AssetEndpointProfilesOperations , AssetsOperations , OperationStatusOperations , Operations
20+ from .operations import (
21+ AssetEndpointProfilesOperations ,
22+ AssetsOperations ,
23+ BillingContainersOperations ,
24+ DiscoveredAssetEndpointProfilesOperations ,
25+ DiscoveredAssetsOperations ,
26+ OperationStatusOperations ,
27+ Operations ,
28+ SchemaRegistriesOperations ,
29+ SchemaVersionsOperations ,
30+ SchemasOperations ,
31+ )
2132
2233if TYPE_CHECKING :
23- # pylint: disable=unused-import,ungrouped-imports
2434 from azure .core .credentials import TokenCredential
2535
2636
27- class DeviceRegistryMgmtClient : # pylint: disable=client-accepts-api-version-keyword
37+ class DeviceRegistryMgmtClient : # pylint: disable=too-many-instance-attributes
2838 """Microsoft.DeviceRegistry Resource Provider management API.
2939
3040 :ivar operations: Operations operations
3141 :vartype operations: azure.mgmt.deviceregistry.operations.Operations
42+ :ivar operation_status: OperationStatusOperations operations
43+ :vartype operation_status: azure.mgmt.deviceregistry.operations.OperationStatusOperations
44+ :ivar assets: AssetsOperations operations
45+ :vartype assets: azure.mgmt.deviceregistry.operations.AssetsOperations
3246 :ivar asset_endpoint_profiles: AssetEndpointProfilesOperations operations
3347 :vartype asset_endpoint_profiles:
3448 azure.mgmt.deviceregistry.operations.AssetEndpointProfilesOperations
35- :ivar assets: AssetsOperations operations
36- :vartype assets: azure.mgmt.deviceregistry.operations.AssetsOperations
37- :ivar operation_status: OperationStatusOperations operations
38- :vartype operation_status: azure.mgmt.deviceregistry.operations.OperationStatusOperations
39- :param credential: Credential needed for the client to connect to Azure. Required.
49+ :ivar billing_containers: BillingContainersOperations operations
50+ :vartype billing_containers: azure.mgmt.deviceregistry.operations.BillingContainersOperations
51+ :ivar discovered_assets: DiscoveredAssetsOperations operations
52+ :vartype discovered_assets: azure.mgmt.deviceregistry.operations.DiscoveredAssetsOperations
53+ :ivar discovered_asset_endpoint_profiles: DiscoveredAssetEndpointProfilesOperations operations
54+ :vartype discovered_asset_endpoint_profiles:
55+ azure.mgmt.deviceregistry.operations.DiscoveredAssetEndpointProfilesOperations
56+ :ivar schema_registries: SchemaRegistriesOperations operations
57+ :vartype schema_registries: azure.mgmt.deviceregistry.operations.SchemaRegistriesOperations
58+ :ivar schemas: SchemasOperations operations
59+ :vartype schemas: azure.mgmt.deviceregistry.operations.SchemasOperations
60+ :ivar schema_versions: SchemaVersionsOperations operations
61+ :vartype schema_versions: azure.mgmt.deviceregistry.operations.SchemaVersionsOperations
62+ :param credential: Credential used to authenticate requests to the service. Required.
4063 :type credential: ~azure.core.credentials.TokenCredential
41- :param subscription_id: The ID of the target subscription. Required.
64+ :param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
4265 :type subscription_id: str
43- :param base_url: Service URL . Default value is "https://management.azure.com".
66+ :param base_url: Service host . Default value is "https://management.azure.com".
4467 :type base_url: str
45- :keyword api_version: Api Version. Default value is "2023-11-01-preview". Note that overriding
46- this default value may result in unsupported behavior.
68+ :keyword api_version: The API version to use for this operation. Default value is
69+ "2024-09-01-preview". Note that overriding this default value may result in unsupported
70+ behavior.
4771 :paramtype api_version: str
4872 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
4973 Retry-After header is present.
@@ -56,8 +80,9 @@ def __init__(
5680 base_url : str = "https://management.azure.com" ,
5781 ** kwargs : Any
5882 ) -> None :
83+ _endpoint = "{endpoint}"
5984 self ._config = DeviceRegistryMgmtClientConfiguration (
60- credential = credential , subscription_id = subscription_id , ** kwargs
85+ credential = credential , subscription_id = subscription_id , base_url = base_url , ** kwargs
6186 )
6287 _policies = kwargs .pop ("policies" , None )
6388 if _policies is None :
@@ -77,28 +102,41 @@ def __init__(
77102 policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
78103 self ._config .http_logging_policy ,
79104 ]
80- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
105+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = _endpoint , policies = _policies , ** kwargs )
81106
82- client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
83- self ._serialize = Serializer (client_models )
84- self ._deserialize = Deserializer (client_models )
107+ self ._serialize = Serializer ()
108+ self ._deserialize = Deserializer ()
85109 self ._serialize .client_side_validation = False
86110 self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
87- self .asset_endpoint_profiles = AssetEndpointProfilesOperations (
111+ self .operation_status = OperationStatusOperations (
88112 self ._client , self ._config , self ._serialize , self ._deserialize
89113 )
90114 self .assets = AssetsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
91- self .operation_status = OperationStatusOperations (
115+ self .asset_endpoint_profiles = AssetEndpointProfilesOperations (
116+ self ._client , self ._config , self ._serialize , self ._deserialize
117+ )
118+ self .billing_containers = BillingContainersOperations (
119+ self ._client , self ._config , self ._serialize , self ._deserialize
120+ )
121+ self .discovered_assets = DiscoveredAssetsOperations (
92122 self ._client , self ._config , self ._serialize , self ._deserialize
93123 )
124+ self .discovered_asset_endpoint_profiles = DiscoveredAssetEndpointProfilesOperations (
125+ self ._client , self ._config , self ._serialize , self ._deserialize
126+ )
127+ self .schema_registries = SchemaRegistriesOperations (
128+ self ._client , self ._config , self ._serialize , self ._deserialize
129+ )
130+ self .schemas = SchemasOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
131+ self .schema_versions = SchemaVersionsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
94132
95- def _send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
133+ def send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
96134 """Runs the network request through the client's chained policies.
97135
98136 >>> from azure.core.rest import HttpRequest
99137 >>> request = HttpRequest("GET", "https://www.example.org/")
100138 <HttpRequest [GET], url: 'https://www.example.org/'>
101- >>> response = client._send_request (request)
139+ >>> response = client.send_request (request)
102140 <HttpResponse: 200 OK>
103141
104142 For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
@@ -111,13 +149,17 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
111149 """
112150
113151 request_copy = deepcopy (request )
114- request_copy .url = self ._client .format_url (request_copy .url )
152+ path_format_arguments = {
153+ "endpoint" : self ._serialize .url ("self._config.base_url" , self ._config .base_url , "str" , skip_quote = True ),
154+ }
155+
156+ request_copy .url = self ._client .format_url (request_copy .url , ** path_format_arguments )
115157 return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
116158
117159 def close (self ) -> None :
118160 self ._client .close ()
119161
120- def __enter__ (self ) -> "DeviceRegistryMgmtClient" :
162+ def __enter__ (self ) -> Self :
121163 self ._client .__enter__ ()
122164 return self
123165
0 commit comments