defaultBankAccount; } public function id(): ?string { return $this->id; } public function requireId(): string { if (! $this->id) { throw new \RuntimeException('Pagar.me recipient creation returned an empty id.'); } return $this->id; } // public static function fromArray(array $payload): self { return new self( id: $payload['id'] ?? null, name: $payload['name'] ?? null, email: $payload['email'] ?? null, document: $payload['document'] ?? null, type: $payload['type'] ?? null, status: $payload['status'] ?? null, defaultBankAccount: ! empty($payload['default_bank_account']) ? PagarmeRecipientBankAccountResponseData::fromArray($payload['default_bank_account']) : null, createdAt: $payload['created_at'] ?? null, updatedAt: $payload['updated_at'] ?? null, ); } public function toArray(): array { return [ 'id' => $this->id, 'name' => $this->name, 'email' => $this->email, 'document' => $this->document, 'type' => $this->type, 'status' => $this->status, 'default_bank_account' => $this->defaultBankAccount?->toArray(), 'created_at' => $this->createdAt, 'updated_at' => $this->updatedAt, ]; } }