1616use GuzzleHttp \Client ;
1717use GuzzleHttp \ClientInterface ;
1818use GuzzleHttp \Exception \ConnectException ;
19+ use GuzzleHttp \Exception \GuzzleException ;
1920use GuzzleHttp \Exception \RequestException ;
2021use GuzzleHttp \Psr7 \Request ;
2122use GuzzleHttp \RequestOptions ;
@@ -52,11 +53,10 @@ public function getConfig(): Configuration
5253 *
5354 * Delete payment method
5455 *
55- * @param int $paymentMethodId Payment method ID (required)
56- *
56+ * @return \Hostinger\Model\CommonSuccessEmptyResource|\Hostinger\Model\CommonSchemaUnauthorizedResponseSchema|\Hostinger\Model\CommonSchemaErrorResponseSchema
5757 * @throws ApiException on non-2xx response or if the response body is not in the expected format
5858 * @throws InvalidArgumentException
59- * @return \Hostinger\Model\CommonSuccessEmptyResource|\Hostinger\Model\CommonSchemaUnauthorizedResponseSchema|\Hostinger\Model\CommonSchemaErrorResponseSchema
59+ * @throws GuzzleException
6060 */
6161 public function deletePaymentMethodV1 (int $ paymentMethodId , ): \Hostinger \Model \CommonSuccessEmptyResource |\Hostinger \Model \CommonSchemaUnauthorizedResponseSchema |\Hostinger \Model \CommonSchemaErrorResponseSchema
6262 {
@@ -65,7 +65,11 @@ public function deletePaymentMethodV1(int $paymentMethodId, ): \Hostinger\Model\
6565 try {
6666 $ response = $ this ->client ->send ($ request , $ this ->createHttpClientOption ());
6767 } catch (RequestException $ e ) {
68- throw ApiException::fromRequestException ($ e );
68+ if ($ this ->config ->shouldThrowException ()) {
69+ throw ApiException::fromRequestException ($ e );
70+ } else {
71+ $ response = $ e ->getResponse ();
72+ }
6973 } catch (ConnectException $ e ) {
7074 throw ApiException::fromConnectException ($ e );
7175 }
@@ -92,7 +96,6 @@ public function deletePaymentMethodV1(int $paymentMethodId, ): \Hostinger\Model\
9296 /**
9397 * Create request for operation 'deletePaymentMethodV1'
9498 *
95- * @param int $paymentMethodId Payment method ID (required)
9699 * @throws InvalidArgumentException
97100 */
98101 protected function deletePaymentMethodV1Request (int $ paymentMethodId ,): Request
@@ -117,10 +120,10 @@ protected function deletePaymentMethodV1Request(int $paymentMethodId,): Request
117120 *
118121 * Get payment method list
119122 *
120- *
123+ * @return \Hostinger\Model\BillingV1PaymentMethodPaymentMethodResource[]|\Hostinger\Model\CommonSchemaUnauthorizedResponseSchema|\Hostinger\Model\CommonSchemaErrorResponseSchema
121124 * @throws ApiException on non-2xx response or if the response body is not in the expected format
122125 * @throws InvalidArgumentException
123- * @return \Hostinger\Model\BillingV1PaymentMethodPaymentMethodResource[]|\Hostinger\Model\CommonSchemaUnauthorizedResponseSchema|\Hostinger\Model\CommonSchemaErrorResponseSchema
126+ * @throws GuzzleException
124127 */
125128 public function getPaymentMethodListV1 (): array |\Hostinger \Model \CommonSchemaUnauthorizedResponseSchema |\Hostinger \Model \CommonSchemaErrorResponseSchema
126129 {
@@ -129,7 +132,11 @@ public function getPaymentMethodListV1(): array|\Hostinger\Model\CommonSchemaUna
129132 try {
130133 $ response = $ this ->client ->send ($ request , $ this ->createHttpClientOption ());
131134 } catch (RequestException $ e ) {
132- throw ApiException::fromRequestException ($ e );
135+ if ($ this ->config ->shouldThrowException ()) {
136+ throw ApiException::fromRequestException ($ e );
137+ } else {
138+ $ response = $ e ->getResponse ();
139+ }
133140 } catch (ConnectException $ e ) {
134141 throw ApiException::fromConnectException ($ e );
135142 }
@@ -173,11 +180,10 @@ protected function getPaymentMethodListV1Request(): Request
173180 *
174181 * Set default payment method
175182 *
176- * @param int $paymentMethodId Payment method ID (required)
177- *
183+ * @return \Hostinger\Model\CommonSuccessEmptyResource|\Hostinger\Model\CommonSchemaUnauthorizedResponseSchema|\Hostinger\Model\CommonSchemaErrorResponseSchema
178184 * @throws ApiException on non-2xx response or if the response body is not in the expected format
179185 * @throws InvalidArgumentException
180- * @return \Hostinger\Model\CommonSuccessEmptyResource|\Hostinger\Model\CommonSchemaUnauthorizedResponseSchema|\Hostinger\Model\CommonSchemaErrorResponseSchema
186+ * @throws GuzzleException
181187 */
182188 public function setDefaultPaymentMethodV1 (int $ paymentMethodId , ): \Hostinger \Model \CommonSuccessEmptyResource |\Hostinger \Model \CommonSchemaUnauthorizedResponseSchema |\Hostinger \Model \CommonSchemaErrorResponseSchema
183189 {
@@ -186,7 +192,11 @@ public function setDefaultPaymentMethodV1(int $paymentMethodId, ): \Hostinger\Mo
186192 try {
187193 $ response = $ this ->client ->send ($ request , $ this ->createHttpClientOption ());
188194 } catch (RequestException $ e ) {
189- throw ApiException::fromRequestException ($ e );
195+ if ($ this ->config ->shouldThrowException ()) {
196+ throw ApiException::fromRequestException ($ e );
197+ } else {
198+ $ response = $ e ->getResponse ();
199+ }
190200 } catch (ConnectException $ e ) {
191201 throw ApiException::fromConnectException ($ e );
192202 }
@@ -213,7 +223,6 @@ public function setDefaultPaymentMethodV1(int $paymentMethodId, ): \Hostinger\Mo
213223 /**
214224 * Create request for operation 'setDefaultPaymentMethodV1'
215225 *
216- * @param int $paymentMethodId Payment method ID (required)
217226 * @throws InvalidArgumentException
218227 */
219228 protected function setDefaultPaymentMethodV1Request (int $ paymentMethodId ,): Request
0 commit comments