commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ResourceCreatedDeliveryPayloadBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
20 use DateTimeImmutable;
21 use stdClass;
22 
27 {
32  private $projectKey;
33 
38  private $resource;
39 
44  private $resourceUserProvidedIdentifiers;
45 
50  private $version;
51 
56  private $modifiedAt;
57 
65  public function getProjectKey()
66  {
67  return $this->projectKey;
68  }
69 
76  public function getResource()
77  {
78  return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource;
79  }
80 
88  {
89  return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers;
90  }
91 
98  public function getVersion()
99  {
100  return $this->version;
101  }
102 
109  public function getModifiedAt()
110  {
111  return $this->modifiedAt;
112  }
113 
118  public function withProjectKey(?string $projectKey)
119  {
120  $this->projectKey = $projectKey;
121 
122  return $this;
123  }
124 
129  public function withResource(?Reference $resource)
130  {
131  $this->resource = $resource;
132 
133  return $this;
134  }
135 
140  public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers)
141  {
142  $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers;
143 
144  return $this;
145  }
146 
151  public function withVersion(?int $version)
152  {
153  $this->version = $version;
154 
155  return $this;
156  }
157 
162  public function withModifiedAt(?DateTimeImmutable $modifiedAt)
163  {
164  $this->modifiedAt = $modifiedAt;
165 
166  return $this;
167  }
168 
173  public function withResourceBuilder(?ReferenceBuilder $resource)
174  {
175  $this->resource = $resource;
176 
177  return $this;
178  }
179 
184  public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers)
185  {
186  $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers;
187 
188  return $this;
189  }
190 
192  {
194  $this->projectKey,
195  $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource,
196  $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers,
197  $this->version,
198  $this->modifiedAt
199  );
200  }
201 
202  public static function of(): ResourceCreatedDeliveryPayloadBuilder
203  {
204  return new self();
205  }
206 }
withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers)
withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers)