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
138 public function getExpiresAt()
139 {
140 return $this->expiresAt;
141 }
142
147 public function withKey(?string $key)
148 {
149 $this->key = $key;
150
151 return $this;
152 }
153
158 public function withResourceType(?string $resourceType)
159 {
160 $this->resourceType = $resourceType;
161
162 return $this;
163 }
164
169 public function withVersion(?int $version)
170 {
171 $this->version = $version;
172
173 return $this;
174 }
175
180 public function withRetentionPolicy(?RetentionPolicy $retentionPolicy)
181 {
182 $this->retentionPolicy = $retentionPolicy;
183
184 return $this;
185 }
186
191 public function withCreatedAt(?DateTimeImmutable $createdAt)
192 {
193 $this->createdAt = $createdAt;
194
195 return $this;
196 }
197
202 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
203 {
204 $this->lastModifiedAt = $lastModifiedAt;
205
206 return $this;
207 }
208
213 public function withExpiresAt(?DateTimeImmutable $expiresAt)
214 {
215 $this->expiresAt = $expiresAt;
216
217 return $this;
218 }
219
224 public function withRetentionPolicyBuilder(?RetentionPolicyBuilder $retentionPolicy)
225 {
226 $this->retentionPolicy = $retentionPolicy;
227
228 return $this;
229 }
230
231 public function build(): ImportContainer
232 {
233 return new ImportContainerModel(
234 $this->key,
235 $this->resourceType,
236 $this->version,
237 $this->retentionPolicy instanceof RetentionPolicyBuilder ? $this->retentionPolicy->build() : $this->retentionPolicy,
238 $this->createdAt,
239 $this->lastModifiedAt,
240 $this->expiresAt
241 );
242 }
243
244 public static function of(): ImportContainerBuilder
245 {
246 return new self();
247 }
248}