@@ -2178,16 +2178,16 @@ def get_long_running_output(pipeline_response):
2178
2178
2179
2179
begin_migrate_sql_container_to_manual_throughput .metadata = {'url' : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput" } # type: ignore
2180
2180
2181
- async def _sql_container_retrieve_throughput_distribution_initial ( # pylint: disable=inconsistent-return-statements
2181
+ async def _sql_container_retrieve_throughput_distribution_initial (
2182
2182
self ,
2183
2183
resource_group_name : str ,
2184
2184
account_name : str ,
2185
2185
database_name : str ,
2186
2186
container_name : str ,
2187
2187
retrieve_throughput_parameters : "_models.RetrieveThroughputParameters" ,
2188
2188
** kwargs : Any
2189
- ) -> None :
2190
- cls = kwargs .pop ('cls' , None ) # type: ClsType[None ]
2189
+ ) -> Optional [ "_models.PhysicalPartitionThroughputInfoResult" ] :
2190
+ cls = kwargs .pop ('cls' , None ) # type: ClsType[Optional["_models.PhysicalPartitionThroughputInfoResult"] ]
2191
2191
error_map = {
2192
2192
401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
2193
2193
}
@@ -2219,26 +2219,32 @@ async def _sql_container_retrieve_throughput_distribution_initial( # pylint: di
2219
2219
)
2220
2220
response = pipeline_response .http_response
2221
2221
2222
- if response .status_code not in [202 ]:
2222
+ if response .status_code not in [200 , 202 ]:
2223
2223
map_error (status_code = response .status_code , response = response , error_map = error_map )
2224
2224
raise HttpResponseError (response = response , error_format = ARMErrorFormat )
2225
2225
2226
+ deserialized = None
2227
+ if response .status_code == 200 :
2228
+ deserialized = self ._deserialize ('PhysicalPartitionThroughputInfoResult' , pipeline_response )
2229
+
2226
2230
if cls :
2227
- return cls (pipeline_response , None , {})
2231
+ return cls (pipeline_response , deserialized , {})
2232
+
2233
+ return deserialized
2228
2234
2229
2235
_sql_container_retrieve_throughput_distribution_initial .metadata = {'url' : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution" } # type: ignore
2230
2236
2231
2237
2232
2238
@distributed_trace_async
2233
- async def begin_sql_container_retrieve_throughput_distribution ( # pylint: disable=inconsistent-return-statements
2239
+ async def begin_sql_container_retrieve_throughput_distribution (
2234
2240
self ,
2235
2241
resource_group_name : str ,
2236
2242
account_name : str ,
2237
2243
database_name : str ,
2238
2244
container_name : str ,
2239
2245
retrieve_throughput_parameters : "_models.RetrieveThroughputParameters" ,
2240
2246
** kwargs : Any
2241
- ) -> AsyncLROPoller [None ]:
2247
+ ) -> AsyncLROPoller ["_models.PhysicalPartitionThroughputInfoResult" ]:
2242
2248
"""Retrieve throughput distribution for an Azure Cosmos DB SQL container.
2243
2249
2244
2250
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -2260,14 +2266,16 @@ async def begin_sql_container_retrieve_throughput_distribution( # pylint: disab
2260
2266
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
2261
2267
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
2262
2268
Retry-After header is present.
2263
- :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
2264
- :rtype: ~azure.core.polling.AsyncLROPoller[None]
2269
+ :return: An instance of AsyncLROPoller that returns either
2270
+ PhysicalPartitionThroughputInfoResult or the result of cls(response)
2271
+ :rtype:
2272
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult]
2265
2273
:raises: ~azure.core.exceptions.HttpResponseError
2266
2274
"""
2267
2275
api_version = kwargs .pop ('api_version' , "2022-02-15-preview" ) # type: str
2268
2276
content_type = kwargs .pop ('content_type' , "application/json" ) # type: Optional[str]
2269
2277
polling = kwargs .pop ('polling' , True ) # type: Union[bool, AsyncPollingMethod]
2270
- cls = kwargs .pop ('cls' , None ) # type: ClsType[None ]
2278
+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models.PhysicalPartitionThroughputInfoResult" ]
2271
2279
lro_delay = kwargs .pop (
2272
2280
'polling_interval' ,
2273
2281
self ._config .polling_interval
@@ -2288,8 +2296,11 @@ async def begin_sql_container_retrieve_throughput_distribution( # pylint: disab
2288
2296
kwargs .pop ('error_map' , None )
2289
2297
2290
2298
def get_long_running_output (pipeline_response ):
2299
+ response = pipeline_response .http_response
2300
+ deserialized = self ._deserialize ('PhysicalPartitionThroughputInfoResult' , pipeline_response )
2291
2301
if cls :
2292
- return cls (pipeline_response , None , {})
2302
+ return cls (pipeline_response , deserialized , {})
2303
+ return deserialized
2293
2304
2294
2305
2295
2306
if polling is True : polling_method = AsyncARMPolling (lro_delay , lro_options = {'final-state-via' : 'location' }, ** kwargs )
@@ -2306,16 +2317,16 @@ def get_long_running_output(pipeline_response):
2306
2317
2307
2318
begin_sql_container_retrieve_throughput_distribution .metadata = {'url' : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution" } # type: ignore
2308
2319
2309
- async def _sql_container_redistribute_throughput_initial ( # pylint: disable=inconsistent-return-statements
2320
+ async def _sql_container_redistribute_throughput_initial (
2310
2321
self ,
2311
2322
resource_group_name : str ,
2312
2323
account_name : str ,
2313
2324
database_name : str ,
2314
2325
container_name : str ,
2315
2326
redistribute_throughput_parameters : "_models.RedistributeThroughputParameters" ,
2316
2327
** kwargs : Any
2317
- ) -> None :
2318
- cls = kwargs .pop ('cls' , None ) # type: ClsType[None ]
2328
+ ) -> Optional [ "_models.PhysicalPartitionThroughputInfoResult" ] :
2329
+ cls = kwargs .pop ('cls' , None ) # type: ClsType[Optional["_models.PhysicalPartitionThroughputInfoResult"] ]
2319
2330
error_map = {
2320
2331
401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
2321
2332
}
@@ -2347,26 +2358,32 @@ async def _sql_container_redistribute_throughput_initial( # pylint: disable=inc
2347
2358
)
2348
2359
response = pipeline_response .http_response
2349
2360
2350
- if response .status_code not in [202 ]:
2361
+ if response .status_code not in [200 , 202 ]:
2351
2362
map_error (status_code = response .status_code , response = response , error_map = error_map )
2352
2363
raise HttpResponseError (response = response , error_format = ARMErrorFormat )
2353
2364
2365
+ deserialized = None
2366
+ if response .status_code == 200 :
2367
+ deserialized = self ._deserialize ('PhysicalPartitionThroughputInfoResult' , pipeline_response )
2368
+
2354
2369
if cls :
2355
- return cls (pipeline_response , None , {})
2370
+ return cls (pipeline_response , deserialized , {})
2371
+
2372
+ return deserialized
2356
2373
2357
2374
_sql_container_redistribute_throughput_initial .metadata = {'url' : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput" } # type: ignore
2358
2375
2359
2376
2360
2377
@distributed_trace_async
2361
- async def begin_sql_container_redistribute_throughput ( # pylint: disable=inconsistent-return-statements
2378
+ async def begin_sql_container_redistribute_throughput (
2362
2379
self ,
2363
2380
resource_group_name : str ,
2364
2381
account_name : str ,
2365
2382
database_name : str ,
2366
2383
container_name : str ,
2367
2384
redistribute_throughput_parameters : "_models.RedistributeThroughputParameters" ,
2368
2385
** kwargs : Any
2369
- ) -> AsyncLROPoller [None ]:
2386
+ ) -> AsyncLROPoller ["_models.PhysicalPartitionThroughputInfoResult" ]:
2370
2387
"""Redistribute throughput for an Azure Cosmos DB SQL container.
2371
2388
2372
2389
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -2389,14 +2406,16 @@ async def begin_sql_container_redistribute_throughput( # pylint: disable=incons
2389
2406
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
2390
2407
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
2391
2408
Retry-After header is present.
2392
- :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
2393
- :rtype: ~azure.core.polling.AsyncLROPoller[None]
2409
+ :return: An instance of AsyncLROPoller that returns either
2410
+ PhysicalPartitionThroughputInfoResult or the result of cls(response)
2411
+ :rtype:
2412
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult]
2394
2413
:raises: ~azure.core.exceptions.HttpResponseError
2395
2414
"""
2396
2415
api_version = kwargs .pop ('api_version' , "2022-02-15-preview" ) # type: str
2397
2416
content_type = kwargs .pop ('content_type' , "application/json" ) # type: Optional[str]
2398
2417
polling = kwargs .pop ('polling' , True ) # type: Union[bool, AsyncPollingMethod]
2399
- cls = kwargs .pop ('cls' , None ) # type: ClsType[None ]
2418
+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models.PhysicalPartitionThroughputInfoResult" ]
2400
2419
lro_delay = kwargs .pop (
2401
2420
'polling_interval' ,
2402
2421
self ._config .polling_interval
@@ -2417,8 +2436,11 @@ async def begin_sql_container_redistribute_throughput( # pylint: disable=incons
2417
2436
kwargs .pop ('error_map' , None )
2418
2437
2419
2438
def get_long_running_output (pipeline_response ):
2439
+ response = pipeline_response .http_response
2440
+ deserialized = self ._deserialize ('PhysicalPartitionThroughputInfoResult' , pipeline_response )
2420
2441
if cls :
2421
- return cls (pipeline_response , None , {})
2442
+ return cls (pipeline_response , deserialized , {})
2443
+ return deserialized
2422
2444
2423
2445
2424
2446
if polling is True : polling_method = AsyncARMPolling (lro_delay , lro_options = {'final-state-via' : 'location' }, ** kwargs )
0 commit comments