88
99namespace LKDev \HetznerCloud \Models \FloatingIps ;
1010
11- use LKDev \HetznerCloud \ApiResponse ;
11+ use LKDev \HetznerCloud \APIResponse ;
1212use LKDev \HetznerCloud \HetznerAPIClient ;
1313use LKDev \HetznerCloud \Models \Actions \Action ;
1414use LKDev \HetznerCloud \Models \Locations \Location ;
@@ -142,18 +142,18 @@ public function delete(): bool
142142 *
143143 * @see https://docs.hetzner.cloud/#resources-floating-ip-actions-post-3
144144 * @param bool $delete
145- * @return ApiResponse
145+ * @return APIResponse
146146 * @throws \LKDev\HetznerCloud\APIException
147147 */
148- public function changeProtection (bool $ delete = true ): ApiResponse
148+ public function changeProtection (bool $ delete = true ): APIResponse
149149 {
150150 $ response = $ this ->httpClient ->post ('floating_ips/ ' . $ this ->id . '/actions/change_protection ' , [
151151 'json ' => [
152152 'delete ' => $ delete ,
153153 ],
154154 ]);
155155 if (!HetznerAPIClient::hasError ($ response )) {
156- return ApiResponse ::create ([
156+ return APIResponse ::create ([
157157 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action )
158158 ]);
159159 }
@@ -164,18 +164,18 @@ public function changeProtection(bool $delete = true): ApiResponse
164164 *
165165 * @see https://docs.hetzner.cloud/#floating-ip-actions-assign-a-floating-ip-to-a-server
166166 * @param Server $server
167- * @return ApiResponse
167+ * @return APIResponse
168168 * @throws \LKDev\HetznerCloud\APIException
169169 */
170- public function assignTo (Server $ server ): ApiResponse
170+ public function assignTo (Server $ server ): APIResponse
171171 {
172172 $ response = $ this ->httpClient ->post ('floating_ips/ ' . $ this ->id . '/actions/assign ' , [
173173 'json ' => [
174174 'server ' => $ server ->id ,
175175 ],
176176 ]);
177177 if (!HetznerAPIClient::hasError ($ response )) {
178- return ApiResponse ::create ([
178+ return APIResponse ::create ([
179179 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action )
180180 ]);
181181 }
@@ -185,14 +185,14 @@ public function assignTo(Server $server): ApiResponse
185185 * Unassigns a Floating IP, resulting in it being unreachable. You may assign it to a server again at a later time.
186186 *
187187 * @see https://docs.hetzner.cloud/#floating-ip-actions-unassign-a-floating-ip
188- * @return ApiResponse
188+ * @return APIResponse
189189 * @throws \LKDev\HetznerCloud\APIException
190190 */
191- public function unassign (): ApiResponse
191+ public function unassign (): APIResponse
192192 {
193193 $ response = $ this ->httpClient ->post ('floating_ips/ ' . $ this ->id . '/actions/unassign ' );
194194 if (!HetznerAPIClient::hasError ($ response )) {
195- return ApiResponse ::create ([
195+ return APIResponse ::create ([
196196 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action )
197197 ]);
198198 }
@@ -204,10 +204,10 @@ public function unassign(): ApiResponse
204204 * @see https://docs.hetzner.cloud/#floating-ip-actions-change-reverse-dns-entry-for-a-floating-ip
205205 * @param string $ip
206206 * @param string $dnsPtr
207- * @return ApiResponse
207+ * @return APIResponse
208208 * @throws \LKDev\HetznerCloud\APIException
209209 */
210- public function changeReverseDNS (string $ ip , string $ dnsPtr ): ApiResponse
210+ public function changeReverseDNS (string $ ip , string $ dnsPtr ): APIResponse
211211 {
212212 $ response = $ this ->httpClient ->post ('floating_ips/ ' . $ this ->id . '/actions/change_dns_ptr ' , [
213213 'json ' => [
@@ -216,7 +216,7 @@ public function changeReverseDNS(string $ip, string $dnsPtr): ApiResponse
216216 ],
217217 ]);
218218 if (!HetznerAPIClient::hasError ($ response )) {
219- return ApiResponse ::create ([
219+ return APIResponse ::create ([
220220 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action )
221221 ]);
222222 }
0 commit comments