@@ -1004,6 +1004,58 @@ def unset_channel_data(
10041004 cast_to = NoneType ,
10051005 )
10061006
1007+ def unset_preferences (
1008+ self ,
1009+ collection : str ,
1010+ object_id : str ,
1011+ id : str ,
1012+ * ,
1013+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1014+ # The extra values given here take precedence over values defined on the client or passed to this method.
1015+ extra_headers : Headers | None = None ,
1016+ extra_query : Query | None = None ,
1017+ extra_body : Body | None = None ,
1018+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
1019+ idempotency_key : str | None = None ,
1020+ ) -> None :
1021+ """
1022+ Unsets the preference set for the object, removing it entirely.
1023+
1024+ Args:
1025+ extra_headers: Send extra headers
1026+
1027+ extra_query: Add additional query parameters to the request
1028+
1029+ extra_body: Add additional JSON properties to the request
1030+
1031+ timeout: Override the client-level default timeout for this request, in seconds
1032+
1033+ idempotency_key: Specify a custom idempotency key for this request
1034+ """
1035+ if not collection :
1036+ raise ValueError (f"Expected a non-empty value for `collection` but received { collection !r} " )
1037+ if not object_id :
1038+ raise ValueError (f"Expected a non-empty value for `object_id` but received { object_id !r} " )
1039+ if not id :
1040+ raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
1041+ extra_headers = {"Accept" : "*/*" , ** (extra_headers or {})}
1042+ return self ._delete (
1043+ path_template (
1044+ "/v1/objects/{collection}/{object_id}/preferences/{id}" ,
1045+ collection = collection ,
1046+ object_id = object_id ,
1047+ id = id ,
1048+ ),
1049+ options = make_request_options (
1050+ extra_headers = extra_headers ,
1051+ extra_query = extra_query ,
1052+ extra_body = extra_body ,
1053+ timeout = timeout ,
1054+ idempotency_key = idempotency_key ,
1055+ ),
1056+ cast_to = NoneType ,
1057+ )
1058+
10071059
10081060class AsyncObjectsResource (AsyncAPIResource ):
10091061 """An object represents a resource in your system that you want to map into Knock."""
@@ -1953,6 +2005,58 @@ async def unset_channel_data(
19532005 cast_to = NoneType ,
19542006 )
19552007
2008+ async def unset_preferences (
2009+ self ,
2010+ collection : str ,
2011+ object_id : str ,
2012+ id : str ,
2013+ * ,
2014+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
2015+ # The extra values given here take precedence over values defined on the client or passed to this method.
2016+ extra_headers : Headers | None = None ,
2017+ extra_query : Query | None = None ,
2018+ extra_body : Body | None = None ,
2019+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
2020+ idempotency_key : str | None = None ,
2021+ ) -> None :
2022+ """
2023+ Unsets the preference set for the object, removing it entirely.
2024+
2025+ Args:
2026+ extra_headers: Send extra headers
2027+
2028+ extra_query: Add additional query parameters to the request
2029+
2030+ extra_body: Add additional JSON properties to the request
2031+
2032+ timeout: Override the client-level default timeout for this request, in seconds
2033+
2034+ idempotency_key: Specify a custom idempotency key for this request
2035+ """
2036+ if not collection :
2037+ raise ValueError (f"Expected a non-empty value for `collection` but received { collection !r} " )
2038+ if not object_id :
2039+ raise ValueError (f"Expected a non-empty value for `object_id` but received { object_id !r} " )
2040+ if not id :
2041+ raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
2042+ extra_headers = {"Accept" : "*/*" , ** (extra_headers or {})}
2043+ return await self ._delete (
2044+ path_template (
2045+ "/v1/objects/{collection}/{object_id}/preferences/{id}" ,
2046+ collection = collection ,
2047+ object_id = object_id ,
2048+ id = id ,
2049+ ),
2050+ options = make_request_options (
2051+ extra_headers = extra_headers ,
2052+ extra_query = extra_query ,
2053+ extra_body = extra_body ,
2054+ timeout = timeout ,
2055+ idempotency_key = idempotency_key ,
2056+ ),
2057+ cast_to = NoneType ,
2058+ )
2059+
19562060
19572061class ObjectsResourceWithRawResponse :
19582062 def __init__ (self , objects : ObjectsResource ) -> None :
@@ -2003,6 +2107,9 @@ def __init__(self, objects: ObjectsResource) -> None:
20032107 self .unset_channel_data = to_raw_response_wrapper (
20042108 objects .unset_channel_data ,
20052109 )
2110+ self .unset_preferences = to_raw_response_wrapper (
2111+ objects .unset_preferences ,
2112+ )
20062113
20072114 @cached_property
20082115 def bulk (self ) -> BulkResourceWithRawResponse :
@@ -2061,6 +2168,9 @@ def __init__(self, objects: AsyncObjectsResource) -> None:
20612168 self .unset_channel_data = async_to_raw_response_wrapper (
20622169 objects .unset_channel_data ,
20632170 )
2171+ self .unset_preferences = async_to_raw_response_wrapper (
2172+ objects .unset_preferences ,
2173+ )
20642174
20652175 @cached_property
20662176 def bulk (self ) -> AsyncBulkResourceWithRawResponse :
@@ -2119,6 +2229,9 @@ def __init__(self, objects: ObjectsResource) -> None:
21192229 self .unset_channel_data = to_streamed_response_wrapper (
21202230 objects .unset_channel_data ,
21212231 )
2232+ self .unset_preferences = to_streamed_response_wrapper (
2233+ objects .unset_preferences ,
2234+ )
21222235
21232236 @cached_property
21242237 def bulk (self ) -> BulkResourceWithStreamingResponse :
@@ -2177,6 +2290,9 @@ def __init__(self, objects: AsyncObjectsResource) -> None:
21772290 self .unset_channel_data = async_to_streamed_response_wrapper (
21782291 objects .unset_channel_data ,
21792292 )
2293+ self .unset_preferences = async_to_streamed_response_wrapper (
2294+ objects .unset_preferences ,
2295+ )
21802296
21812297 @cached_property
21822298 def bulk (self ) -> AsyncBulkResourceWithStreamingResponse :
0 commit comments