@@ -766,6 +766,8 @@ def upsert_item( # pylint:disable=docstring-missing-param
766
766
* ,
767
767
session_token : Optional [str ] = None ,
768
768
initial_headers : Optional [Dict [str , str ]] = None ,
769
+ etag : Optional [str ] = None ,
770
+ match_condition : Optional [MatchConditions ] = None ,
769
771
priority : Optional [Literal ["High" , "Low" ]] = None ,
770
772
no_response : Optional [bool ] = None ,
771
773
response_hook : Optional [Callable [[Mapping [str , str ], Dict [str , Any ]], None ]] = None ,
@@ -782,6 +784,9 @@ def upsert_item( # pylint:disable=docstring-missing-param
782
784
:param str post_trigger_include: trigger id to be used as post operation trigger.
783
785
:keyword str session_token: Token for use with Session consistency.
784
786
:keyword Dict[str, str] initial_headers: Initial headers to be sent as part of the request.
787
+ :keyword str etag: An ETag value, or the wildcard character (*). Used to check if the resource
788
+ has changed, and act according to the condition specified by the `match_condition` parameter.
789
+ :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag.
785
790
:keyword response_hook: A callable invoked with the response metadata.
786
791
:paramtype response_hook: Callable[[Mapping[str, str], Dict[str, Any]], None]
787
792
:keyword Literal["High", "Low"] priority: Priority based execution allows users to set a priority for each
@@ -794,18 +799,6 @@ def upsert_item( # pylint:disable=docstring-missing-param
794
799
:returns: A CosmosDict representing the upserted item. The dict will be empty if `no_response` is specified.
795
800
:rtype: ~azure.cosmos.CosmosDict[str, Any]
796
801
"""
797
- etag = kwargs .get ('etag' )
798
- if etag is not None :
799
- warnings .warn (
800
- "The 'etag' flag does not apply to this method and is always ignored even if passed."
801
- " It will now be removed in the future." ,
802
- DeprecationWarning )
803
- match_condition = kwargs .get ('match_condition' )
804
- if match_condition is not None :
805
- warnings .warn (
806
- "The 'match_condition' flag does not apply to this method and is always ignored even if passed."
807
- " It will now be removed in the future." ,
808
- DeprecationWarning )
809
802
if pre_trigger_include is not None :
810
803
kwargs ['pre_trigger_include' ] = pre_trigger_include
811
804
if post_trigger_include is not None :
@@ -816,6 +809,10 @@ def upsert_item( # pylint:disable=docstring-missing-param
816
809
kwargs ['initial_headers' ] = initial_headers
817
810
if priority is not None :
818
811
kwargs ['priority' ] = priority
812
+ if etag is not None :
813
+ kwargs ['etag' ] = etag
814
+ if match_condition is not None :
815
+ kwargs ['match_condition' ] = match_condition
819
816
if no_response is not None :
820
817
kwargs ['no_response' ] = no_response
821
818
if response_hook is not None :
0 commit comments