-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathCartsConfigurationModel.php
More file actions
182 lines (160 loc) · 5.82 KB
/
Copy pathCartsConfigurationModel.php
File metadata and controls
182 lines (160 loc) · 5.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<?php
declare(strict_types=1);
/**
* This file has been auto generated
* Do not change it.
*/
namespace Commercetools\Api\Models\Project;
use Commercetools\Base\DateTimeImmutableCollection;
use Commercetools\Base\JsonObject;
use Commercetools\Base\JsonObjectModel;
use Commercetools\Base\MapperFactory;
use stdClass;
/**
* @internal
*/
final class CartsConfigurationModel extends JsonObjectModel implements CartsConfiguration
{
/**
*
* @var ?int
*/
protected $deleteDaysAfterLastModification;
/**
*
* @var ?bool
*/
protected $countryTaxRateFallbackEnabled;
/**
*
* @var ?string
*/
protected $priceRoundingMode;
/**
*
* @var ?string
*/
protected $taxRoundingMode;
/**
* @psalm-suppress MissingParamType
*/
public function __construct(
?int $deleteDaysAfterLastModification = null,
?bool $countryTaxRateFallbackEnabled = null,
?string $priceRoundingMode = null,
?string $taxRoundingMode = null
) {
$this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification;
$this->countryTaxRateFallbackEnabled = $countryTaxRateFallbackEnabled;
$this->priceRoundingMode = $priceRoundingMode;
$this->taxRoundingMode = $taxRoundingMode;
}
/**
* <p>Default value for the <code>deleteDaysAfterLastModification</code> parameter of the <a href="ctp:api:type:CartDraft">CartDraft</a> and <a href="ctp:api:type:MyCartDraft">MyCartDraft</a>.</p>
* <ul>
* <li>If a <a href="ctp:api:type:ChangeSubscription">ChangeSubscription</a> for Carts exists, a <a href="ctp:api:type:ResourceDeletedDeliveryPayload">ResourceDeletedDeliveryPayload</a> is sent upon deletion of a Cart.</li>
* <li>Carts with <a href="ctp:api:type:CartOrigin">CartOrigin</a> <code>Quote</code> or <code>RecurringOrder</code> are not affected by this configuration value.</li>
* <li>Changing this value doesn't affect the retention of existing Carts. To update an existing Cart's retention use <a href="/projects/carts#set-deletedaysafterlastmodification"><code>setDeleteDaysAfterLastModification</code></a> on the Carts API.</li>
* <li>This field may not be present on Projects created before January 2020.</li>
* </ul>
*
*
* @return null|int
*/
public function getDeleteDaysAfterLastModification()
{
if (is_null($this->deleteDaysAfterLastModification)) {
/** @psalm-var ?int $data */
$data = $this->raw(self::FIELD_DELETE_DAYS_AFTER_LAST_MODIFICATION);
if (is_null($data)) {
return null;
}
$this->deleteDaysAfterLastModification = (int) $data;
}
return $this->deleteDaysAfterLastModification;
}
/**
* <p>Indicates if country <em>- no state</em> Tax Rate fallback should be used when a shipping address state is not explicitly covered in the rates lists of all Tax Categories of a Cart Line Items. This field may not be present on Projects created before June 2020.</p>
*
*
* @return null|bool
*/
public function getCountryTaxRateFallbackEnabled()
{
if (is_null($this->countryTaxRateFallbackEnabled)) {
/** @psalm-var ?bool $data */
$data = $this->raw(self::FIELD_COUNTRY_TAX_RATE_FALLBACK_ENABLED);
if (is_null($data)) {
return null;
}
$this->countryTaxRateFallbackEnabled = (bool) $data;
}
return $this->countryTaxRateFallbackEnabled;
}
/**
* <p>Default value for the <code>priceRoundingMode</code> parameter of the <a href="ctp:api:type:CartDraft">CartDraft</a>.
* Indicates how the total prices on <a href="ctp:api:type:LineItem">LineItems</a> and <a href="ctp:api:type:CustomLineItem">CustomLineItems</a> are rounded when calculated.</p>
*
*
* @return null|string
*/
public function getPriceRoundingMode()
{
if (is_null($this->priceRoundingMode)) {
/** @psalm-var ?string $data */
$data = $this->raw(self::FIELD_PRICE_ROUNDING_MODE);
if (is_null($data)) {
return null;
}
$this->priceRoundingMode = (string) $data;
}
return $this->priceRoundingMode;
}
/**
* <p>Default value for the <code>taxRoundingMode</code> parameter of the <a href="ctp:api:type:CartDraft">CartDraft</a>.
* Indicates how monetary values are rounded when calculating taxes for <code>taxedPrice</code>.</p>
*
*
* @return null|string
*/
public function getTaxRoundingMode()
{
if (is_null($this->taxRoundingMode)) {
/** @psalm-var ?string $data */
$data = $this->raw(self::FIELD_TAX_ROUNDING_MODE);
if (is_null($data)) {
return null;
}
$this->taxRoundingMode = (string) $data;
}
return $this->taxRoundingMode;
}
/**
* @param ?int $deleteDaysAfterLastModification
*/
public function setDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification): void
{
$this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification;
}
/**
* @param ?bool $countryTaxRateFallbackEnabled
*/
public function setCountryTaxRateFallbackEnabled(?bool $countryTaxRateFallbackEnabled): void
{
$this->countryTaxRateFallbackEnabled = $countryTaxRateFallbackEnabled;
}
/**
* @param ?string $priceRoundingMode
*/
public function setPriceRoundingMode(?string $priceRoundingMode): void
{
$this->priceRoundingMode = $priceRoundingMode;
}
/**
* @param ?string $taxRoundingMode
*/
public function setTaxRoundingMode(?string $taxRoundingMode): void
{
$this->taxRoundingMode = $taxRoundingMode;
}
}