Skip to content

Commit 49d1c1b

Browse files
qdegraaftleguijt
authored andcommitted
regenerate
1 parent 2158787 commit 49d1c1b

File tree

12 files changed

+118
-37
lines changed

12 files changed

+118
-37
lines changed

src/commercetools/importapi/models/_schemas/importoperations.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ class ImportOperationSchema(helpers.BaseSchema):
3838
missing=None,
3939
data_key="resourceVersion",
4040
)
41-
retry_count = marshmallow.fields.Integer(
42-
allow_none=True, missing=None, data_key="retryCount"
43-
)
4441
errors = marshmallow.fields.List(
4542
helpers.Discriminator(
4643
allow_none=True,

src/commercetools/importapi/models/_schemas/importsummaries.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,6 @@ class OperationStatesSchema(helpers.BaseSchema):
4949
imported = marshmallow.fields.Integer(
5050
allow_none=True, missing=None, data_key="Imported"
5151
)
52-
delete = marshmallow.fields.Integer(
53-
allow_none=True, missing=None, data_key="Delete"
54-
)
55-
deleted = marshmallow.fields.Integer(
56-
allow_none=True, missing=None, data_key="Deleted"
57-
)
5852
rejected = marshmallow.fields.Integer(
5953
allow_none=True, missing=None, data_key="Rejected"
6054
)

src/commercetools/importapi/models/common.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -851,8 +851,6 @@ class ProcessingState(enum.Enum):
851851
UNRESOLVED = "Unresolved"
852852
WAIT_FOR_MASTER_VARIANT = "WaitForMasterVariant"
853853
IMPORTED = "Imported"
854-
DELETE = "Delete"
855-
DELETED = "Deleted"
856854
REJECTED = "Rejected"
857855

858856

src/commercetools/importapi/models/customfields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ def serialize(self) -> typing.Dict[str, typing.Any]:
410410
class ReferenceField(CustomField):
411411
"""A field with a reference value."""
412412

413-
#: References a resource by its key.
413+
#: References a resource by its key
414414
value: "KeyReference"
415415

416416
def __init__(self, *, value: "KeyReference"):

src/commercetools/importapi/models/importoperations.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ class ImportOperation(_BaseType):
3939
state: "ProcessingState"
4040
#: When the resource is successfully imported, this represents the imported resource version
4141
resource_version: typing.Optional[int]
42-
#: The number of request retries for processing the import resource.
43-
retry_count: int
4442
#: If an import resource does not import correctly, the state is set to `Rejected` or `ValidationFailed`
4543
#: and this property contains the errors.
4644
errors: typing.Optional[typing.List["ErrorObject"]]
@@ -60,7 +58,6 @@ def __init__(
6058
id: str,
6159
state: "ProcessingState",
6260
resource_version: typing.Optional[int] = None,
63-
retry_count: int,
6461
errors: typing.Optional[typing.List["ErrorObject"]] = None,
6562
created_at: datetime.datetime,
6663
last_modified_at: datetime.datetime,
@@ -72,7 +69,6 @@ def __init__(
7269
self.id = id
7370
self.state = state
7471
self.resource_version = resource_version
75-
self.retry_count = retry_count
7672
self.errors = errors
7773
self.created_at = created_at
7874
self.last_modified_at = last_modified_at
@@ -136,7 +132,6 @@ class ImportOperationState(enum.Enum):
136132

137133
UNRESOLVED = "Unresolved"
138134
VALIDATION_FAILED = "ValidationFailed"
139-
DELETE = "Delete"
140135

141136

142137
class ImportOperationStatus(_BaseType):

src/commercetools/importapi/models/importsummaries.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ class OperationStates(_BaseType):
5252
wait_for_master_variant: int
5353
#: The number of import operations that are in the state `Imported`.
5454
imported: int
55-
#: The number of import operations that are in the state `Delete`.
56-
delete: int
57-
#: The number of import operations that are in the state `Deleted`.
58-
deleted: int
5955
#: The number of import operations that are in the state `Rejected`.
6056
rejected: int
6157

@@ -66,16 +62,12 @@ def __init__(
6662
unresolved: int,
6763
wait_for_master_variant: int,
6864
imported: int,
69-
delete: int,
70-
deleted: int,
7165
rejected: int
7266
):
7367
self.validation_failed = validation_failed
7468
self.unresolved = unresolved
7569
self.wait_for_master_variant = wait_for_master_variant
7670
self.imported = imported
77-
self.delete = delete
78-
self.deleted = deleted
7971
self.rejected = rejected
8072
super().__init__()
8173

src/commercetools/platform/client/search/by_project_key_product_projections_search_request_builder.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def __init__(
2929

3030
def post(
3131
self,
32+
body: str,
3233
*,
3334
headers: typing.Dict[str, str] = None,
3435
options: typing.Dict[str, typing.Any] = None,
@@ -38,7 +39,7 @@ def post(
3839
response = self._client._post(
3940
endpoint=f"/{self._project_key}/product-projections/search",
4041
params={},
41-
headers=headers,
42+
headers={"Content-Type": "application/x-www-form-urlencoded", **headers},
4243
options=options,
4344
)
4445
if response.status_code in (400, 401, 403, 500, 503):

src/commercetools/platform/client/states/by_project_key_states_key_by_key_request_builder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def get(
3737
headers: typing.Dict[str, str] = None,
3838
options: typing.Dict[str, typing.Any] = None,
3939
) -> typing.Optional["State"]:
40-
"""Get State by Key"""
40+
"""Get State by key"""
4141
headers = {} if headers is None else headers
4242
response = self._client._get(
4343
endpoint=f"/{self._project_key}/states/key={self._key}",
@@ -62,7 +62,7 @@ def post(
6262
headers: typing.Dict[str, str] = None,
6363
options: typing.Dict[str, typing.Any] = None,
6464
) -> typing.Optional["State"]:
65-
"""Update State by Key"""
65+
"""Update State by key"""
6666
headers = {} if headers is None else headers
6767
response = self._client._post(
6868
endpoint=f"/{self._project_key}/states/key={self._key}",
@@ -88,7 +88,7 @@ def delete(
8888
headers: typing.Dict[str, str] = None,
8989
options: typing.Dict[str, typing.Any] = None,
9090
) -> typing.Optional["State"]:
91-
"""Delete State by Key"""
91+
"""Delete State by key"""
9292
headers = {} if headers is None else headers
9393
response = self._client._delete(
9494
endpoint=f"/{self._project_key}/states/key={self._key}",

src/commercetools/platform/models/_schemas/project.py

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from commercetools import helpers
1414

1515
from ... import models
16+
from ..project import SearchIndexingConfigurationStatus
1617
from ..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

210220
class 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+
276323
class ProjectChangeCountriesActionSchema(ProjectUpdateActionSchema):
277324
countries = marshmallow.fields.List(
278325
marshmallow.fields.String(allow_none=True), allow_none=True, missing=None

src/commercetools/platform/models/_schemas/shipping_method.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,8 +739,9 @@ def post_load(self, data, **kwargs):
739739
class ShippingMethodSetLocalizedDescriptionActionSchema(
740740
ShippingMethodUpdateActionSchema
741741
):
742-
localized_description = marshmallow.fields.String(
742+
localized_description = LocalizedStringField(
743743
allow_none=True,
744+
values=marshmallow.fields.String(allow_none=True),
744745
metadata={"omit_empty": True},
745746
missing=None,
746747
data_key="localizedDescription",

0 commit comments

Comments
 (0)