@@ -29,29 +29,31 @@ class _CustomObjectQuerySchema(
2929
3030
3131class _CustomObjectDeleteSchema (
32- traits .VersionedSchema , traits .ExpandableSchema , traits .DataErasureSchema
32+ traits .DataErasureSchema , traits .VersionedSchema , traits .ExpandableSchema
3333):
3434 version = OptionalList (fields .String (), required = False )
3535
3636
3737class CustomObjectService (abstract .AbstractService ):
3838 """Store custom JSON values."""
3939
40- def get_by_container_and_key (
41- self , container , key , * , expand : OptionalListStr = None
40+ def get_by_container (
41+ self , container : str , * , expand : OptionalListStr = None
4242 ) -> CustomObject :
43- """Get CustomObject by container and key"""
4443 params = self ._serialize_params ({"expand" : expand }, traits .ExpandableSchema )
4544 return self ._client ._get (
46- endpoint = f"custom-objects/{ container } / { key } " ,
45+ endpoint = f"custom-objects/{ container } " ,
4746 params = params ,
4847 schema_cls = CustomObjectSchema ,
4948 )
5049
51- def get_by_id (self , id : str , * , expand : OptionalListStr = None ) -> CustomObject :
50+ def get_by_container_and_key (
51+ self , container , key , * , expand : OptionalListStr = None
52+ ) -> CustomObject :
53+ """Get CustomObject by container and key"""
5254 params = self ._serialize_params ({"expand" : expand }, traits .ExpandableSchema )
5355 return self ._client ._get (
54- endpoint = f"custom-objects/{ id } " ,
56+ endpoint = f"custom-objects/{ container } / { key } " ,
5557 params = params ,
5658 schema_cls = CustomObjectSchema ,
5759 )
@@ -80,7 +82,7 @@ def query(
8082 "sort" : sort ,
8183 "limit" : limit ,
8284 "offset" : offset ,
83- "withTotal " : with_total ,
85+ "with_total " : with_total ,
8486 "where" : where ,
8587 "predicate_var" : predicate_var ,
8688 },
@@ -148,7 +150,7 @@ def delete_by_container_and_key(
148150 ) -> CustomObject :
149151 """Delete CustomObject by container and key"""
150152 params = self ._serialize_params (
151- {"dataErasure " : data_erasure , "version" : version , "expand" : expand },
153+ {"data_erasure " : data_erasure , "version" : version , "expand" : expand },
152154 _CustomObjectDeleteSchema ,
153155 )
154156 return self ._client ._delete (
@@ -157,28 +159,3 @@ def delete_by_container_and_key(
157159 response_schema_cls = CustomObjectSchema ,
158160 force_delete = force_delete ,
159161 )
160-
161- def delete_by_id (
162- self ,
163- id : str ,
164- * ,
165- version : str = None ,
166- expand : OptionalListStr = None ,
167- data_erasure : bool = None ,
168- force_delete : bool = False ,
169- ) -> CustomObject :
170- """The version control is optional.
171-
172- If the query contains a version, then it must match the version of the
173- object.
174- """
175- params = self ._serialize_params (
176- {"version" : version , "expand" : expand , "dataErasure" : data_erasure },
177- _CustomObjectDeleteSchema ,
178- )
179- return self ._client ._delete (
180- endpoint = f"custom-objects/{ id } " ,
181- params = params ,
182- response_schema_cls = CustomObjectSchema ,
183- force_delete = force_delete ,
184- )
0 commit comments