diff --git a/sdk/cosmos/azure-cosmos/azure/cosmos/aio/_container.py b/sdk/cosmos/azure-cosmos/azure/cosmos/aio/_container.py index c7d3c07b32e3..eab0b39fe7eb 100644 --- a/sdk/cosmos/azure-cosmos/azure/cosmos/aio/_container.py +++ b/sdk/cosmos/azure-cosmos/azure/cosmos/aio/_container.py @@ -1447,6 +1447,8 @@ async def get_throughput( async def replace_throughput( self, throughput: Union[int, ThroughputProperties], + *, + response_hook: Optional[Callable[[Mapping[str, Any], CosmosDict], None]] = None, **kwargs: Any ) -> ThroughputProperties: """Replace the container's throughput. @@ -1456,7 +1458,7 @@ async def replace_throughput( :param throughput: The throughput to be set. :type throughput: Union[int, ~azure.cosmos.ThroughputProperties] :keyword response_hook: A callable invoked with the response metadata. - :paramtype response_hook: Callable[[Dict[str, str], Dict[str, Any]], None] + :paramtype response_hook: Callable[[Mapping[str, Any], CosmosDict], None] :raises ~azure.cosmos.exceptions.CosmosHttpResponseError: No throughput properties exist for the container or the throughput properties could not be updated. :returns: ThroughputProperties for the container, updated with new throughput. @@ -1477,7 +1479,7 @@ async def replace_throughput( _replace_throughput(throughput=throughput, new_throughput_properties=new_offer) data = await self.client_connection.ReplaceOffer(offer_link=throughput_properties[0]["_self"], offer=throughput_properties[0], **kwargs) - + return ThroughputProperties(offer_throughput=data["content"]["offerThroughput"], properties=data) @distributed_trace diff --git a/sdk/cosmos/azure-cosmos/azure/cosmos/container.py b/sdk/cosmos/azure-cosmos/azure/cosmos/container.py index adb9012fb25b..b7bd32820bfa 100644 --- a/sdk/cosmos/azure-cosmos/azure/cosmos/container.py +++ b/sdk/cosmos/azure-cosmos/azure/cosmos/container.py @@ -1628,6 +1628,8 @@ def get_throughput( def replace_throughput( self, throughput: Union[int, ThroughputProperties], + *, + response_hook: Optional[Callable[[Mapping[str, Any], CosmosDict], None]] = None, **kwargs: Any ) -> ThroughputProperties: """Replace the container's throughput. @@ -1636,6 +1638,8 @@ def replace_throughput( :param throughput: The throughput to be set. :type throughput: Union[int, ~azure.cosmos.ThroughputProperties] + :keyword response_hook: A callable invoked with the response metadata. + :paramtype response_hook: Callable[[Mapping[str, Any], CosmosDict], None] :returns: ThroughputProperties for the container, updated with new throughput. :raises ~azure.cosmos.exceptions.CosmosHttpResponseError: No throughput properties exist for the container or the throughput properties could not be updated.