commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ImportContainerBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use DateTimeImmutable;
17use stdClass;
18
22final class ImportContainerBuilder implements Builder
23{
28 private $key;
29
34 private $resourceType;
35
40 private $version;
41
46 private $retentionPolicy;
47
52 private $createdAt;
53
58 private $lastModifiedAt;
59
64 private $expiresAt;
65
72 public function getKey()
73 {
74 return $this->key;
75 }
76
83 public function getResourceType()
84 {
85 return $this->resourceType;
86 }
87
94 public function getVersion()
95 {
96 return $this->version;
97 }
98
105 public function getRetentionPolicy()
106 {
107 return $this->retentionPolicy instanceof RetentionPolicyBuilder ? $this->retentionPolicy->build() : $this->retentionPolicy;
108 }
109
116 public function getCreatedAt()
117 {
118 return $this->createdAt;
119 }
120
127 public function getLastModifiedAt()
128 {
129 return $this->lastModifiedAt;
130 }
131
139 public function getExpiresAt()
140 {
141 return $this->expiresAt;
142 }
143
148 public function withKey(?string $key)
149 {
150 $this->key = $key;
151
152 return $this;
153 }
154
159 public function withResourceType(?string $resourceType)
160 {
161 $this->resourceType = $resourceType;
162
163 return $this;
164 }
165
170 public function withVersion(?int $version)
171 {
172 $this->version = $version;
173
174 return $this;
175 }
176
181 public function withRetentionPolicy(?RetentionPolicy $retentionPolicy)
182 {
183 $this->retentionPolicy = $retentionPolicy;
184
185 return $this;
186 }
187
192 public function withCreatedAt(?DateTimeImmutable $createdAt)
193 {
194 $this->createdAt = $createdAt;
195
196 return $this;
197 }
198
203 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
204 {
205 $this->lastModifiedAt = $lastModifiedAt;
206
207 return $this;
208 }
209
214 public function withExpiresAt(?DateTimeImmutable $expiresAt)
215 {
216 $this->expiresAt = $expiresAt;
217
218 return $this;
219 }
220
225 public function withRetentionPolicyBuilder(?RetentionPolicyBuilder $retentionPolicy)
226 {
227 $this->retentionPolicy = $retentionPolicy;
228
229 return $this;
230 }
231
232 public function build(): ImportContainer
233 {
234 return new ImportContainerModel(
235 $this->key,
236 $this->resourceType,
237 $this->version,
238 $this->retentionPolicy instanceof RetentionPolicyBuilder ? $this->retentionPolicy->build() : $this->retentionPolicy,
239 $this->createdAt,
240 $this->lastModifiedAt,
241 $this->expiresAt
242 );
243 }
244
245 public static function of(): ImportContainerBuilder
246 {
247 return new self();
248 }
249}