commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
AuthErrorResponseBuilder.php
1<?php
2
3declare(strict_types=1);
10
18use stdClass;
19
23final class AuthErrorResponseBuilder implements Builder
24{
29 private $statusCode;
30
35 private $message;
36
41 private $errors;
42
47 private $error;
48
53 private $error_description;
54
61 public function getStatusCode()
62 {
63 return $this->statusCode;
64 }
65
72 public function getMessage()
73 {
74 return $this->message;
75 }
76
83 public function getErrors()
84 {
85 return $this->errors;
86 }
87
94 public function getError()
95 {
96 return $this->error;
97 }
98
105 public function getError_description()
106 {
107 return $this->error_description;
108 }
109
114 public function withStatusCode(?int $statusCode)
115 {
116 $this->statusCode = $statusCode;
117
118 return $this;
119 }
120
125 public function withMessage(?string $message)
126 {
127 $this->message = $message;
128
129 return $this;
130 }
131
136 public function withErrors(?ErrorObjectCollection $errors)
137 {
138 $this->errors = $errors;
139
140 return $this;
141 }
142
147 public function withError(?string $error)
148 {
149 $this->error = $error;
150
151 return $this;
152 }
153
158 public function withError_description(?string $error_description)
159 {
160 $this->error_description = $error_description;
161
162 return $this;
163 }
164
165
166 public function build(): AuthErrorResponse
167 {
168 return new AuthErrorResponseModel(
169 $this->statusCode,
170 $this->message,
171 $this->errors,
172 $this->error,
173 $this->error_description
174 );
175 }
176
177 public static function of(): AuthErrorResponseBuilder
178 {
179 return new self();
180 }
181}