66# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77# --------------------------------------------------------------------------
88
9- from typing import TYPE_CHECKING
9+ from copy import deepcopy
10+ from typing import Any , Optional , TYPE_CHECKING
1011
12+ from azure .core .rest import HttpRequest , HttpResponse
1113from azure .mgmt .core import ARMPipelineClient
1214from msrest import Deserializer , Serializer
1315
16+ from . import models
17+ from ._configuration import AzureMediaServicesConfiguration
18+ from .operations import AccountFiltersOperations , AssetFiltersOperations , AssetsOperations , ContentKeyPoliciesOperations , JobsOperations , LiveEventsOperations , LiveOutputsOperations , LocationsOperations , MediaservicesOperations , OperationResultsOperations , OperationStatusesOperations , Operations , PrivateEndpointConnectionsOperations , PrivateLinkResourcesOperations , StreamingEndpointsOperations , StreamingLocatorsOperations , StreamingPoliciesOperations , TracksOperations , TransformsOperations
19+
1420if TYPE_CHECKING :
1521 # pylint: disable=unused-import,ungrouped-imports
16- from typing import Any , Optional
17-
1822 from azure .core .credentials import TokenCredential
19- from azure .core .pipeline .transport import HttpRequest , HttpResponse
20-
21- from ._configuration import AzureMediaServicesConfiguration
22- from .operations import Operations
23- from .operations import MediaservicesOperations
24- from .operations import PrivateLinkResourcesOperations
25- from .operations import PrivateEndpointConnectionsOperations
26- from .operations import LocationsOperations
27- from .operations import AccountFiltersOperations
28- from .operations import AssetsOperations
29- from .operations import AssetFiltersOperations
30- from .operations import ContentKeyPoliciesOperations
31- from .operations import TransformsOperations
32- from .operations import JobsOperations
33- from .operations import StreamingPoliciesOperations
34- from .operations import StreamingLocatorsOperations
35- from .operations import LiveEventsOperations
36- from .operations import LiveOutputsOperations
37- from .operations import StreamingEndpointsOperations
38- from . import models
39-
4023
41- class AzureMediaServices ( object ) :
24+ class AzureMediaServices :
4225 """This Swagger was generated by the API Framework.
4326
27+ :ivar account_filters: AccountFiltersOperations operations
28+ :vartype account_filters: azure.mgmt.media.operations.AccountFiltersOperations
4429 :ivar operations: Operations operations
4530 :vartype operations: azure.mgmt.media.operations.Operations
4631 :ivar mediaservices: MediaservicesOperations operations
4732 :vartype mediaservices: azure.mgmt.media.operations.MediaservicesOperations
4833 :ivar private_link_resources: PrivateLinkResourcesOperations operations
4934 :vartype private_link_resources: azure.mgmt.media.operations.PrivateLinkResourcesOperations
5035 :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
51- :vartype private_endpoint_connections: azure.mgmt.media.operations.PrivateEndpointConnectionsOperations
36+ :vartype private_endpoint_connections:
37+ azure.mgmt.media.operations.PrivateEndpointConnectionsOperations
5238 :ivar locations: LocationsOperations operations
5339 :vartype locations: azure.mgmt.media.operations.LocationsOperations
54- :ivar account_filters: AccountFiltersOperations operations
55- :vartype account_filters: azure.mgmt.media.operations.AccountFiltersOperations
5640 :ivar assets: AssetsOperations operations
5741 :vartype assets: azure.mgmt.media.operations.AssetsOperations
5842 :ivar asset_filters: AssetFiltersOperations operations
5943 :vartype asset_filters: azure.mgmt.media.operations.AssetFiltersOperations
44+ :ivar tracks: TracksOperations operations
45+ :vartype tracks: azure.mgmt.media.operations.TracksOperations
46+ :ivar operation_statuses: OperationStatusesOperations operations
47+ :vartype operation_statuses: azure.mgmt.media.operations.OperationStatusesOperations
48+ :ivar operation_results: OperationResultsOperations operations
49+ :vartype operation_results: azure.mgmt.media.operations.OperationResultsOperations
6050 :ivar content_key_policies: ContentKeyPoliciesOperations operations
6151 :vartype content_key_policies: azure.mgmt.media.operations.ContentKeyPoliciesOperations
6252 :ivar transforms: TransformsOperations operations
@@ -77,78 +67,72 @@ class AzureMediaServices(object):
7767 :type credential: ~azure.core.credentials.TokenCredential
7868 :param subscription_id: The unique identifier for a Microsoft Azure subscription.
7969 :type subscription_id: str
80- :param str base_url: Service URL
81- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
70+ :param base_url: Service URL. Default value is 'https://management.azure.com'.
71+ :type base_url: str
72+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
73+ Retry-After header is present.
8274 """
8375
8476 def __init__ (
8577 self ,
86- credential , # type: "TokenCredential"
87- subscription_id , # type: str
88- base_url = None , # type: Optional[str]
89- ** kwargs # type: Any
90- ):
91- # type: (...) -> None
92- if not base_url :
93- base_url = 'https://management.azure.com'
94- self ._config = AzureMediaServicesConfiguration (credential , subscription_id , ** kwargs )
78+ credential : "TokenCredential" ,
79+ subscription_id : str ,
80+ base_url : str = "https://management.azure.com" ,
81+ ** kwargs : Any
82+ ) -> None :
83+ self ._config = AzureMediaServicesConfiguration (credential = credential , subscription_id = subscription_id , ** kwargs )
9584 self ._client = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
9685
9786 client_models = {k : v for k , v in models .__dict__ .items () if isinstance (v , type )}
9887 self ._serialize = Serializer (client_models )
99- self ._serialize .client_side_validation = False
10088 self ._deserialize = Deserializer (client_models )
101-
102- self .operations = Operations (
103- self ._client , self ._config , self ._serialize , self ._deserialize )
104- self .mediaservices = MediaservicesOperations (
105- self ._client , self ._config , self ._serialize , self ._deserialize )
106- self .private_link_resources = PrivateLinkResourcesOperations (
107- self ._client , self ._config , self ._serialize , self ._deserialize )
108- self .private_endpoint_connections = PrivateEndpointConnectionsOperations (
109- self ._client , self ._config , self ._serialize , self ._deserialize )
110- self .locations = LocationsOperations (
111- self ._client , self ._config , self ._serialize , self ._deserialize )
112- self .account_filters = AccountFiltersOperations (
113- self ._client , self ._config , self ._serialize , self ._deserialize )
114- self .assets = AssetsOperations (
115- self ._client , self ._config , self ._serialize , self ._deserialize )
116- self .asset_filters = AssetFiltersOperations (
117- self ._client , self ._config , self ._serialize , self ._deserialize )
118- self .content_key_policies = ContentKeyPoliciesOperations (
119- self ._client , self ._config , self ._serialize , self ._deserialize )
120- self .transforms = TransformsOperations (
121- self ._client , self ._config , self ._serialize , self ._deserialize )
122- self .jobs = JobsOperations (
123- self ._client , self ._config , self ._serialize , self ._deserialize )
124- self .streaming_policies = StreamingPoliciesOperations (
125- self ._client , self ._config , self ._serialize , self ._deserialize )
126- self .streaming_locators = StreamingLocatorsOperations (
127- self ._client , self ._config , self ._serialize , self ._deserialize )
128- self .live_events = LiveEventsOperations (
129- self ._client , self ._config , self ._serialize , self ._deserialize )
130- self .live_outputs = LiveOutputsOperations (
131- self ._client , self ._config , self ._serialize , self ._deserialize )
132- self .streaming_endpoints = StreamingEndpointsOperations (
133- self ._client , self ._config , self ._serialize , self ._deserialize )
134-
135- def _send_request (self , http_request , ** kwargs ):
136- # type: (HttpRequest, Any) -> HttpResponse
89+ self ._serialize .client_side_validation = False
90+ self .account_filters = AccountFiltersOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
91+ self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
92+ self .mediaservices = MediaservicesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
93+ self .private_link_resources = PrivateLinkResourcesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
94+ self .private_endpoint_connections = PrivateEndpointConnectionsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
95+ self .locations = LocationsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
96+ self .assets = AssetsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
97+ self .asset_filters = AssetFiltersOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
98+ self .tracks = TracksOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
99+ self .operation_statuses = OperationStatusesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
100+ self .operation_results = OperationResultsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
101+ self .content_key_policies = ContentKeyPoliciesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
102+ self .transforms = TransformsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
103+ self .jobs = JobsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
104+ self .streaming_policies = StreamingPoliciesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
105+ self .streaming_locators = StreamingLocatorsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
106+ self .live_events = LiveEventsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
107+ self .live_outputs = LiveOutputsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
108+ self .streaming_endpoints = StreamingEndpointsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
109+
110+
111+ def _send_request (
112+ self ,
113+ request , # type: HttpRequest
114+ ** kwargs : Any
115+ ) -> HttpResponse :
137116 """Runs the network request through the client's chained policies.
138117
139- :param http_request: The network request you want to make. Required.
140- :type http_request: ~azure.core.pipeline.transport.HttpRequest
141- :keyword bool stream: Whether the response payload will be streamed. Defaults to True.
118+ >>> from azure.core.rest import HttpRequest
119+ >>> request = HttpRequest("GET", "https://www.example.org/")
120+ <HttpRequest [GET], url: 'https://www.example.org/'>
121+ >>> response = client._send_request(request)
122+ <HttpResponse: 200 OK>
123+
124+ For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
125+
126+ :param request: The network request you want to make. Required.
127+ :type request: ~azure.core.rest.HttpRequest
128+ :keyword bool stream: Whether the response payload will be streamed. Defaults to False.
142129 :return: The response of your network call. Does not do error handling on your response.
143- :rtype: ~azure.core.pipeline.transport .HttpResponse
130+ :rtype: ~azure.core.rest .HttpResponse
144131 """
145- path_format_arguments = {
146- 'subscriptionId' : self ._serialize .url ("self._config.subscription_id" , self ._config .subscription_id , 'str' ),
147- }
148- http_request .url = self ._client .format_url (http_request .url , ** path_format_arguments )
149- stream = kwargs .pop ("stream" , True )
150- pipeline_response = self ._client ._pipeline .run (http_request , stream = stream , ** kwargs )
151- return pipeline_response .http_response
132+
133+ request_copy = deepcopy (request )
134+ request_copy .url = self ._client .format_url (request_copy .url )
135+ return self ._client .send_request (request_copy , ** kwargs )
152136
153137 def close (self ):
154138 # type: () -> None
0 commit comments