1313from commercetools import helpers
1414
1515from ... import models
16+ from ..project import SearchIndexingConfigurationStatus
1617from ..shipping_method import ShippingRateTierType
1718
1819# Fields
@@ -26,6 +27,12 @@ class CartsConfigurationSchema(helpers.BaseSchema):
2627 missing = None ,
2728 data_key = "countryTaxRateFallbackEnabled" ,
2829 )
30+ delete_days_after_last_modification = marshmallow .fields .Integer (
31+ allow_none = True ,
32+ metadata = {"omit_empty" : True },
33+ missing = None ,
34+ data_key = "deleteDaysAfterLastModification" ,
35+ )
2936
3037 class Meta :
3138 unknown = marshmallow .EXCLUDE
@@ -132,6 +139,9 @@ class ProjectUpdateSchema(helpers.BaseSchema):
132139 allow_none = True ,
133140 discriminator_field = ("action" , "action" ),
134141 discriminator_schemas = {
142+ "changeCartsConfiguration" : helpers .absmod (
143+ __name__ , ".ProjectChangeCartsConfigurationSchema"
144+ ),
135145 "changeCountries" : helpers .absmod (
136146 __name__ , ".ProjectChangeCountriesActionSchema"
137147 ),
@@ -208,8 +218,26 @@ def post_load(self, data, **kwargs):
208218
209219
210220class SearchIndexingConfigurationValuesSchema (helpers .BaseSchema ):
211- status = marshmallow .fields .String (
212- allow_none = True , metadata = {"omit_empty" : True }, missing = None
221+ status = marshmallow_enum .EnumField (
222+ SearchIndexingConfigurationStatus ,
223+ by_value = True ,
224+ allow_none = True ,
225+ metadata = {"omit_empty" : True },
226+ missing = None ,
227+ )
228+ last_modified_at = marshmallow .fields .DateTime (
229+ allow_none = True ,
230+ metadata = {"omit_empty" : True },
231+ missing = None ,
232+ data_key = "lastModifiedAt" ,
233+ )
234+ last_modified_by = helpers .LazyNestedField (
235+ nested = helpers .absmod (__name__ , ".common.LastModifiedBySchema" ),
236+ allow_none = True ,
237+ unknown = marshmallow .EXCLUDE ,
238+ metadata = {"omit_empty" : True },
239+ missing = None ,
240+ data_key = "lastModifiedBy" ,
213241 )
214242
215243 class Meta :
@@ -273,6 +301,25 @@ def post_load(self, data, **kwargs):
273301 return models .CartValueType (** data )
274302
275303
304+ class ProjectChangeCartsConfigurationSchema (ProjectUpdateActionSchema ):
305+ carts_configuration = helpers .LazyNestedField (
306+ nested = helpers .absmod (__name__ , ".CartsConfigurationSchema" ),
307+ allow_none = True ,
308+ unknown = marshmallow .EXCLUDE ,
309+ metadata = {"omit_empty" : True },
310+ missing = None ,
311+ data_key = "cartsConfiguration" ,
312+ )
313+
314+ class Meta :
315+ unknown = marshmallow .EXCLUDE
316+
317+ @marshmallow .post_load
318+ def post_load (self , data , ** kwargs ):
319+ del data ["action" ]
320+ return models .ProjectChangeCartsConfiguration (** data )
321+
322+
276323class ProjectChangeCountriesActionSchema (ProjectUpdateActionSchema ):
277324 countries = marshmallow .fields .List (
278325 marshmallow .fields .String (allow_none = True ), allow_none = True , missing = None
0 commit comments