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
71 public function getRetentionPolicy()
72 {
73 return $this->retentionPolicy instanceof RetentionPolicyBuilder ? $this->retentionPolicy->build() : $this->retentionPolicy;
74 }
75
80 public function withKey(?string $key)
81 {
82 $this->key = $key;
83
84 return $this;
85 }
86
91 public function withResourceType(?string $resourceType)
92 {
93 $this->resourceType = $resourceType;
94
95 return $this;
96 }
97
102 public function withRetentionPolicy(?RetentionPolicy $retentionPolicy)
103 {
104 $this->retentionPolicy = $retentionPolicy;
105
106 return $this;
107 }
108
113 public function withRetentionPolicyBuilder(?RetentionPolicyBuilder $retentionPolicy)
114 {
115 $this->retentionPolicy = $retentionPolicy;
116
117 return $this;
118 }
119
120 public function build(): ImportContainerDraft
121 {
122 return new ImportContainerDraftModel(
123 $this->key,
124 $this->resourceType,
125 $this->retentionPolicy instanceof RetentionPolicyBuilder ? $this->retentionPolicy->build() : $this->retentionPolicy
126 );
127 }
128
129 public static function of(): ImportContainerDraftBuilder
130 {
131 return new self();
132 }
133}