* @throws ServiceException On an error answer. */ public function lists(): array; /** * The fields an answer can be sent to, without email and name (those have * their own rows in the mapping). * * @param string $listId List, audience or form ID (some services ignore it). * @return array * @throws ServiceException On an error answer. */ public function fields( string $listId ): array; /** * Whether the person is already known to the service (in the list, for * services whose contacts belong to a list). * * @param string $listId List, audience or form ID. * @param string $email Email address. * @throws ServiceException On an error answer other than "not found". */ public function isMember( string $listId, string $email ): bool; /** * Add or update one person. Every request of the delivery goes through * here, so a retry repeats the same steps (all of them are safe to repeat). * * @param Subscriber $sub Subscriber. * @param callable|null $bodyFilter Receives the body of the main request and returns it. * @return array{status:string,member:string,notes:string[]} `status` is subscribed, pending, updated or another member status. * @throws ServiceException On a failed request. */ public function subscribe( Subscriber $sub, ?callable $bodyFilter = null ): array; }