commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
AgentResponsesQuoteRequestSuccessModel.php
1<?php
2
3declare(strict_types=1);
10
18use stdClass;
19
24{
25 public const DISCRIMINATOR_VALUE = 'QuoteRequest';
30 protected $entityType;
31
36 protected $warnings;
37
42 protected $threadId;
43
48 protected $entity;
49
54 protected $cartId;
55
56
60 public function __construct(
62 ?string $threadId = null,
63 ?QuoteRequest $entity = null,
64 ?string $cartId = null,
65 ?string $entityType = null
66 ) {
67 $this->warnings = $warnings;
68 $this->threadId = $threadId;
69 $this->entity = $entity;
70 $this->cartId = $cartId;
71 $this->entityType = $entityType ?? self::DISCRIMINATOR_VALUE;
72 }
73
80 public function getEntityType()
81 {
82 if (is_null($this->entityType)) {
84 $data = $this->raw(self::FIELD_ENTITY_TYPE);
85 if (is_null($data)) {
86 return null;
87 }
88 $this->entityType = (string) $data;
89 }
90
91 return $this->entityType;
92 }
93
100 public function getWarnings()
101 {
102 if (is_null($this->warnings)) {
104 $data = $this->raw(self::FIELD_WARNINGS);
105 if (is_null($data)) {
106 return null;
107 }
108 $this->warnings = WarningObjectCollection::fromArray($data);
109 }
110
111 return $this->warnings;
112 }
113
120 public function getThreadId()
121 {
122 if (is_null($this->threadId)) {
124 $data = $this->raw(self::FIELD_THREAD_ID);
125 if (is_null($data)) {
126 return null;
127 }
128 $this->threadId = (string) $data;
129 }
130
131 return $this->threadId;
132 }
133
140 public function getEntity()
141 {
142 if (is_null($this->entity)) {
144 $data = $this->raw(self::FIELD_ENTITY);
145 if (is_null($data)) {
146 return null;
147 }
148
149 $this->entity = QuoteRequestModel::of($data);
150 }
151
152 return $this->entity;
153 }
154
161 public function getCartId()
162 {
163 if (is_null($this->cartId)) {
165 $data = $this->raw(self::FIELD_CART_ID);
166 if (is_null($data)) {
167 return null;
168 }
169 $this->cartId = (string) $data;
170 }
171
172 return $this->cartId;
173 }
174
175
180 {
181 $this->warnings = $warnings;
182 }
183
187 public function setThreadId(?string $threadId): void
188 {
189 $this->threadId = $threadId;
190 }
191
195 public function setEntity(?QuoteRequest $entity): void
196 {
197 $this->entity = $entity;
198 }
199
203 public function setCartId(?string $cartId): void
204 {
205 $this->cartId = $cartId;
206 }
207}
__construct(?WarningObjectCollection $warnings=null, ?string $threadId=null, ?QuoteRequest $entity=null, ?string $cartId=null, ?string $entityType=null)