2222 "StoreSetNameActionSchema" ,
2323 "StoreUpdateActionSchema" ,
2424 "StoreUpdateSchema" ,
25+ "StoresAddDistributionChannelsActionSchema" ,
26+ "StoresRemoveDistributionChannelsActionSchema" ,
27+ "StoresSetDistributionChannelsActionSchema" ,
2528]
2629
2730
@@ -32,6 +35,14 @@ class StoreDraftSchema(marshmallow.Schema):
3235 languages = marshmallow .fields .List (
3336 marshmallow .fields .String (allow_none = True ), missing = None
3437 )
38+ distribution_channels = marshmallow .fields .Nested (
39+ nested = "commercetools.schemas._channel.ChannelResourceIdentifierSchema" ,
40+ unknown = marshmallow .EXCLUDE ,
41+ allow_none = True ,
42+ many = True ,
43+ missing = None ,
44+ data_key = "distributionChannels" ,
45+ )
3546
3647 class Meta :
3748 unknown = marshmallow .EXCLUDE
@@ -131,6 +142,13 @@ class StoreSchema(BaseResourceSchema):
131142 languages = marshmallow .fields .List (
132143 marshmallow .fields .String (allow_none = True ), missing = None
133144 )
145+ distribution_channels = marshmallow .fields .Nested (
146+ nested = "commercetools.schemas._channel.ChannelReferenceSchema" ,
147+ unknown = marshmallow .EXCLUDE ,
148+ allow_none = True ,
149+ many = True ,
150+ data_key = "distributionChannels" ,
151+ )
134152
135153 class Meta :
136154 unknown = marshmallow .EXCLUDE
@@ -162,6 +180,9 @@ class StoreUpdateSchema(marshmallow.Schema):
162180 discriminator_schemas = {
163181 "setLanguages" : "commercetools.schemas._store.StoreSetLanguagesActionSchema" ,
164182 "setName" : "commercetools.schemas._store.StoreSetNameActionSchema" ,
183+ "addDistributionChannel" : "commercetools.schemas._store.StoresAddDistributionChannelsActionSchema" ,
184+ "removeDistributionChannel" : "commercetools.schemas._store.StoresRemoveDistributionChannelsActionSchema" ,
185+ "setDistributionChannels" : "commercetools.schemas._store.StoresSetDistributionChannelsActionSchema" ,
165186 },
166187 unknown = marshmallow .EXCLUDE ,
167188 allow_none = True ,
@@ -203,3 +224,59 @@ class Meta:
203224 def post_load (self , data , ** kwargs ):
204225 del data ["action" ]
205226 return types .StoreSetNameAction (** data )
227+
228+
229+ class StoresAddDistributionChannelsActionSchema (StoreUpdateActionSchema ):
230+ "Marshmallow schema for :class:`commercetools.types.StoresAddDistributionChannelsAction`."
231+ distribution_channel = marshmallow .fields .Nested (
232+ nested = "commercetools.schemas._channel.ChannelResourceIdentifierSchema" ,
233+ unknown = marshmallow .EXCLUDE ,
234+ allow_none = True ,
235+ data_key = "distributionChannel" ,
236+ )
237+
238+ class Meta :
239+ unknown = marshmallow .EXCLUDE
240+
241+ @marshmallow .post_load
242+ def post_load (self , data , ** kwargs ):
243+ del data ["action" ]
244+ return types .StoresAddDistributionChannelsAction (** data )
245+
246+
247+ class StoresRemoveDistributionChannelsActionSchema (StoreUpdateActionSchema ):
248+ "Marshmallow schema for :class:`commercetools.types.StoresRemoveDistributionChannelsAction`."
249+ distribution_channel = marshmallow .fields .Nested (
250+ nested = "commercetools.schemas._channel.ChannelResourceIdentifierSchema" ,
251+ unknown = marshmallow .EXCLUDE ,
252+ allow_none = True ,
253+ data_key = "distributionChannel" ,
254+ )
255+
256+ class Meta :
257+ unknown = marshmallow .EXCLUDE
258+
259+ @marshmallow .post_load
260+ def post_load (self , data , ** kwargs ):
261+ del data ["action" ]
262+ return types .StoresRemoveDistributionChannelsAction (** data )
263+
264+
265+ class StoresSetDistributionChannelsActionSchema (StoreUpdateActionSchema ):
266+ "Marshmallow schema for :class:`commercetools.types.StoresSetDistributionChannelsAction`."
267+ distribution_channels = marshmallow .fields .Nested (
268+ nested = "commercetools.schemas._channel.ChannelResourceIdentifierSchema" ,
269+ unknown = marshmallow .EXCLUDE ,
270+ allow_none = True ,
271+ many = True ,
272+ missing = None ,
273+ data_key = "distributionChannels" ,
274+ )
275+
276+ class Meta :
277+ unknown = marshmallow .EXCLUDE
278+
279+ @marshmallow .post_load
280+ def post_load (self , data , ** kwargs ):
281+ del data ["action" ]
282+ return types .StoresSetDistributionChannelsAction (** data )
0 commit comments