77use SentDm \Core \Attributes \Optional ;
88use SentDm \Core \Concerns \SdkModel ;
99use SentDm \Core \Contracts \BaseModel ;
10- use SentDm \Webhooks \APIError ;
1110use SentDm \Webhooks \APIMeta ;
11+ use SentDm \Webhooks \ErrorDetail ;
1212
1313/**
1414 * Standard API response envelope for all v3 endpoints.
1515 *
1616 * @phpstan-import-type ContactResponseShape from \SentDm\Contacts\ContactResponse
17- * @phpstan-import-type APIErrorShape from \SentDm\Webhooks\APIError
17+ * @phpstan-import-type ErrorDetailShape from \SentDm\Webhooks\ErrorDetail
1818 * @phpstan-import-type APIMetaShape from \SentDm\Webhooks\APIMeta
1919 *
2020 * @phpstan-type APIResponseOfContactShape = array{
2121 * data?: null|ContactResponse|ContactResponseShape,
22- * error?: null|APIError|APIErrorShape ,
22+ * error?: null|ErrorDetail|ErrorDetailShape ,
2323 * meta?: null|APIMeta|APIMetaShape,
2424 * success?: bool|null,
2525 * }
@@ -40,7 +40,7 @@ final class APIResponseOfContact implements BaseModel
4040 * Error information.
4141 */
4242 #[Optional(nullable: true )]
43- public ?APIError $ error ;
43+ public ?ErrorDetail $ error ;
4444
4545 /**
4646 * Request and response metadata.
@@ -65,12 +65,12 @@ public function __construct()
6565 * You must use named parameters to construct any parameters with a default value.
6666 *
6767 * @param ContactResponse|ContactResponseShape|null $data
68- * @param APIError|APIErrorShape |null $error
68+ * @param ErrorDetail|ErrorDetailShape |null $error
6969 * @param APIMeta|APIMetaShape|null $meta
7070 */
7171 public static function with (
7272 ContactResponse |array |null $ data = null ,
73- APIError |array |null $ error = null ,
73+ ErrorDetail |array |null $ error = null ,
7474 APIMeta |array |null $ meta = null ,
7575 ?bool $ success = null ,
7676 ): self {
@@ -101,9 +101,9 @@ public function withData(ContactResponse|array|null $data): self
101101 /**
102102 * Error information.
103103 *
104- * @param APIError|APIErrorShape |null $error
104+ * @param ErrorDetail|ErrorDetailShape |null $error
105105 */
106- public function withError (APIError |array |null $ error ): self
106+ public function withError (ErrorDetail |array |null $ error ): self
107107 {
108108 $ self = clone $ this ;
109109 $ self ['error ' ] = $ error ;
0 commit comments