commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ImportContainerDraftBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
17
22{
27 private $key;
28
33 private $resourceType;
34
39 private $retentionPolicy;
40
47 public function getKey()
48 {
49 return $this->key;
50 }
51
59 public function getResourceType()
60 {
61 return $this->resourceType;
62 }
63
70 public function getRetentionPolicy()
71 {
72 return $this->retentionPolicy instanceof RetentionPolicyBuilder ? $this->retentionPolicy->build() : $this->retentionPolicy;
73 }
74
79 public function withKey(?string $key)
80 {
81 $this->key = $key;
82
83 return $this;
84 }
85
90 public function withResourceType(?string $resourceType)
91 {
92 $this->resourceType = $resourceType;
93
94 return $this;
95 }
96
101 public function withRetentionPolicy(?RetentionPolicy $retentionPolicy)
102 {
103 $this->retentionPolicy = $retentionPolicy;
104
105 return $this;
106 }
107
112 public function withRetentionPolicyBuilder(?RetentionPolicyBuilder $retentionPolicy)
113 {
114 $this->retentionPolicy = $retentionPolicy;
115
116 return $this;
117 }
118
119 public function build(): ImportContainerDraft
120 {
121 return new ImportContainerDraftModel(
122 $this->key,
123 $this->resourceType,
124 $this->retentionPolicy instanceof RetentionPolicyBuilder ? $this->retentionPolicy->build() : $this->retentionPolicy
125 );
126 }
127
128 public static function of(): ImportContainerDraftBuilder
129 {
130 return new self();
131 }
132}