Skip to content

Commit 6ed7dd3

Browse files
Merge pull request #410 from commercetools/gen-sdk-updates
Update generated SDKs
2 parents 107a071 + 80c188e commit 6ed7dd3

20 files changed

+976
-22
lines changed

changes.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,9 @@
407407
<details>
408408
<summary>Added Property(s)</summary>
409409

410+
- added property `retentionPolicy` to type `ImportContainer`
411+
- added property `expiresAt` to type `ImportContainer`
412+
- added property `retentionPolicy` to type `ImportContainerDraft`
410413
- added property `/^[a-zA-Z]{2,3}(?:-[a-zA-Z]{4})?(?:-(?:[a-zA-Z]{2}|\d{3}))?$/` to type `SearchKeywords`
411414
- added property `attributes` to type `ProductImport`
412415
- added property `attributes` to type `ProductDraftImport`
@@ -426,6 +429,10 @@
426429
<details>
427430
<summary>Added Type(s)</summary>
428431

432+
- added type `StrategyEnum`
433+
- added type `RetentionPolicy`
434+
- added type `TimeToLiveConfig`
435+
- added type `TimeToLiveRetentionPolicy`
429436
- added type `AttributeLevel`
430437
</details>
431438

lib/commercetools-import/src/Models/Importcontainers/ImportContainer.php

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ interface ImportContainer extends JsonObject
1717
public const FIELD_KEY = 'key';
1818
public const FIELD_RESOURCE_TYPE = 'resourceType';
1919
public const FIELD_VERSION = 'version';
20+
public const FIELD_RETENTION_POLICY = 'retentionPolicy';
2021
public const FIELD_CREATED_AT = 'createdAt';
2122
public const FIELD_LAST_MODIFIED_AT = 'lastModifiedAt';
23+
public const FIELD_EXPIRES_AT = 'expiresAt';
2224

2325
/**
24-
* <p>User-defined unique identifier for the ImportContainer.
25-
* Keys can only contain alphanumeric characters (a-Z, 0-9), underscores and hyphens (_, -).</p>
26+
* <p>User-defined unique identifier for the ImportContainer.</p>
2627
*
2728
2829
* @return null|string
@@ -47,21 +48,37 @@ public function getResourceType();
4748
public function getVersion();
4849

4950
/**
50-
* <p>The time when the ImportContainer was created.</p>
51+
* <p>The retention policy of the ImportContainer.</p>
52+
*
53+
54+
* @return null|RetentionPolicy
55+
*/
56+
public function getRetentionPolicy();
57+
58+
/**
59+
* <p>Date and time (UTC) the ImportContainer was initially created.</p>
5160
*
5261
5362
* @return null|DateTimeImmutable
5463
*/
5564
public function getCreatedAt();
5665

5766
/**
58-
* <p>The last time when the ImportContainer was modified.</p>
67+
* <p>Date and time (UTC) the ImportContainer was last updated.</p>
5968
*
6069
6170
* @return null|DateTimeImmutable
6271
*/
6372
public function getLastModifiedAt();
6473

74+
/**
75+
* <p>Date and time (UTC) the ImportContainer is automatically deleted. Only present if a <code>retentionPolicy</code> is set. ImportContainers without <code>expiresAt</code> are permanent until <a href="#delete-importcontainer">manually deleted</a>.</p>
76+
*
77+
78+
* @return null|DateTimeImmutable
79+
*/
80+
public function getExpiresAt();
81+
6582
/**
6683
* @param ?string $key
6784
*/
@@ -77,6 +94,11 @@ public function setResourceType(?string $resourceType): void;
7794
*/
7895
public function setVersion(?int $version): void;
7996

97+
/**
98+
* @param ?RetentionPolicy $retentionPolicy
99+
*/
100+
public function setRetentionPolicy(?RetentionPolicy $retentionPolicy): void;
101+
80102
/**
81103
* @param ?DateTimeImmutable $createdAt
82104
*/
@@ -86,4 +108,9 @@ public function setCreatedAt(?DateTimeImmutable $createdAt): void;
86108
* @param ?DateTimeImmutable $lastModifiedAt
87109
*/
88110
public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void;
111+
112+
/**
113+
* @param ?DateTimeImmutable $expiresAt
114+
*/
115+
public function setExpiresAt(?DateTimeImmutable $expiresAt): void;
89116
}

lib/commercetools-import/src/Models/Importcontainers/ImportContainerBuilder.php

Lines changed: 72 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ final class ImportContainerBuilder implements Builder
3939
*/
4040
private $version;
4141

42+
/**
43+
44+
* @var null|RetentionPolicy|RetentionPolicyBuilder
45+
*/
46+
private $retentionPolicy;
47+
4248
/**
4349
4450
* @var ?DateTimeImmutable
@@ -52,8 +58,13 @@ final class ImportContainerBuilder implements Builder
5258
private $lastModifiedAt;
5359

5460
/**
55-
* <p>User-defined unique identifier for the ImportContainer.
56-
* Keys can only contain alphanumeric characters (a-Z, 0-9), underscores and hyphens (_, -).</p>
61+
62+
* @var ?DateTimeImmutable
63+
*/
64+
private $expiresAt;
65+
66+
/**
67+
* <p>User-defined unique identifier for the ImportContainer.</p>
5768
*
5869
5970
* @return null|string
@@ -87,7 +98,18 @@ public function getVersion()
8798
}
8899

89100
/**
90-
* <p>The time when the ImportContainer was created.</p>
101+
* <p>The retention policy of the ImportContainer.</p>
102+
*
103+
104+
* @return null|RetentionPolicy
105+
*/
106+
public function getRetentionPolicy()
107+
{
108+
return $this->retentionPolicy instanceof RetentionPolicyBuilder ? $this->retentionPolicy->build() : $this->retentionPolicy;
109+
}
110+
111+
/**
112+
* <p>Date and time (UTC) the ImportContainer was initially created.</p>
91113
*
92114
93115
* @return null|DateTimeImmutable
@@ -98,7 +120,7 @@ public function getCreatedAt()
98120
}
99121

100122
/**
101-
* <p>The last time when the ImportContainer was modified.</p>
123+
* <p>Date and time (UTC) the ImportContainer was last updated.</p>
102124
*
103125
104126
* @return null|DateTimeImmutable
@@ -108,6 +130,17 @@ public function getLastModifiedAt()
108130
return $this->lastModifiedAt;
109131
}
110132

133+
/**
134+
* <p>Date and time (UTC) the ImportContainer is automatically deleted. Only present if a <code>retentionPolicy</code> is set. ImportContainers without <code>expiresAt</code> are permanent until <a href="#delete-importcontainer">manually deleted</a>.</p>
135+
*
136+
137+
* @return null|DateTimeImmutable
138+
*/
139+
public function getExpiresAt()
140+
{
141+
return $this->expiresAt;
142+
}
143+
111144
/**
112145
* @param ?string $key
113146
* @return $this
@@ -141,6 +174,17 @@ public function withVersion(?int $version)
141174
return $this;
142175
}
143176

177+
/**
178+
* @param ?RetentionPolicy $retentionPolicy
179+
* @return $this
180+
*/
181+
public function withRetentionPolicy(?RetentionPolicy $retentionPolicy)
182+
{
183+
$this->retentionPolicy = $retentionPolicy;
184+
185+
return $this;
186+
}
187+
144188
/**
145189
* @param ?DateTimeImmutable $createdAt
146190
* @return $this
@@ -163,15 +207,38 @@ public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
163207
return $this;
164208
}
165209

210+
/**
211+
* @param ?DateTimeImmutable $expiresAt
212+
* @return $this
213+
*/
214+
public function withExpiresAt(?DateTimeImmutable $expiresAt)
215+
{
216+
$this->expiresAt = $expiresAt;
217+
218+
return $this;
219+
}
220+
221+
/**
222+
* @deprecated use withRetentionPolicy() instead
223+
* @return $this
224+
*/
225+
public function withRetentionPolicyBuilder(?RetentionPolicyBuilder $retentionPolicy)
226+
{
227+
$this->retentionPolicy = $retentionPolicy;
228+
229+
return $this;
230+
}
166231

167232
public function build(): ImportContainer
168233
{
169234
return new ImportContainerModel(
170235
$this->key,
171236
$this->resourceType,
172237
$this->version,
238+
$this->retentionPolicy instanceof RetentionPolicyBuilder ? $this->retentionPolicy->build() : $this->retentionPolicy,
173239
$this->createdAt,
174-
$this->lastModifiedAt
240+
$this->lastModifiedAt,
241+
$this->expiresAt
175242
);
176243
}
177244

lib/commercetools-import/src/Models/Importcontainers/ImportContainerDraft.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ interface ImportContainerDraft extends JsonObject
1515
{
1616
public const FIELD_KEY = 'key';
1717
public const FIELD_RESOURCE_TYPE = 'resourceType';
18+
public const FIELD_RETENTION_POLICY = 'retentionPolicy';
1819

1920
/**
20-
* <p>User-defined unique identifier of the ImportContainer.
21-
* Keys can only contain alphanumeric characters (a-Z, 0-9), underscores and hyphens (_, -).</p>
21+
* <p>User-defined unique identifier of the ImportContainer.</p>
2222
*
2323
2424
* @return null|string
@@ -34,6 +34,14 @@ public function getKey();
3434
*/
3535
public function getResourceType();
3636

37+
/**
38+
* <p>Set a retention policy to automatically delete the ImportContainer after a defined period.</p>
39+
*
40+
41+
* @return null|RetentionPolicy
42+
*/
43+
public function getRetentionPolicy();
44+
3745
/**
3846
* @param ?string $key
3947
*/
@@ -43,4 +51,9 @@ public function setKey(?string $key): void;
4351
* @param ?string $resourceType
4452
*/
4553
public function setResourceType(?string $resourceType): void;
54+
55+
/**
56+
* @param ?RetentionPolicy $retentionPolicy
57+
*/
58+
public function setRetentionPolicy(?RetentionPolicy $retentionPolicy): void;
4659
}

lib/commercetools-import/src/Models/Importcontainers/ImportContainerDraftBuilder.php

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,13 @@ final class ImportContainerDraftBuilder implements Builder
3333
private $resourceType;
3434

3535
/**
36-
* <p>User-defined unique identifier of the ImportContainer.
37-
* Keys can only contain alphanumeric characters (a-Z, 0-9), underscores and hyphens (_, -).</p>
36+
37+
* @var null|RetentionPolicy|RetentionPolicyBuilder
38+
*/
39+
private $retentionPolicy;
40+
41+
/**
42+
* <p>User-defined unique identifier of the ImportContainer.</p>
3843
*
3944
4045
* @return null|string
@@ -56,6 +61,17 @@ public function getResourceType()
5661
return $this->resourceType;
5762
}
5863

64+
/**
65+
* <p>Set a retention policy to automatically delete the ImportContainer after a defined period.</p>
66+
*
67+
68+
* @return null|RetentionPolicy
69+
*/
70+
public function getRetentionPolicy()
71+
{
72+
return $this->retentionPolicy instanceof RetentionPolicyBuilder ? $this->retentionPolicy->build() : $this->retentionPolicy;
73+
}
74+
5975
/**
6076
* @param ?string $key
6177
* @return $this
@@ -78,12 +94,34 @@ public function withResourceType(?string $resourceType)
7894
return $this;
7995
}
8096

97+
/**
98+
* @param ?RetentionPolicy $retentionPolicy
99+
* @return $this
100+
*/
101+
public function withRetentionPolicy(?RetentionPolicy $retentionPolicy)
102+
{
103+
$this->retentionPolicy = $retentionPolicy;
104+
105+
return $this;
106+
}
107+
108+
/**
109+
* @deprecated use withRetentionPolicy() instead
110+
* @return $this
111+
*/
112+
public function withRetentionPolicyBuilder(?RetentionPolicyBuilder $retentionPolicy)
113+
{
114+
$this->retentionPolicy = $retentionPolicy;
115+
116+
return $this;
117+
}
81118

82119
public function build(): ImportContainerDraft
83120
{
84121
return new ImportContainerDraftModel(
85122
$this->key,
86-
$this->resourceType
123+
$this->resourceType,
124+
$this->retentionPolicy instanceof RetentionPolicyBuilder ? $this->retentionPolicy->build() : $this->retentionPolicy
87125
);
88126
}
89127

0 commit comments

Comments
 (0)