--- trunk/Nos.pm 2005/08/25 00:37:48 77 +++ trunk/Nos.pm 2005/08/25 00:56:06 78 @@ -718,11 +718,11 @@ { id => 42, # unique ID of received message - list => 'My list', # useful only of filtering by email - ext_id => 9999, # ext_id from message user - email => 'jdoe@example.com', # e-mail of user - bounced => 0, # true value if message is bounce - date => '2005-08-24 18:57:24', # date of recival in ISO format + list => 'My list', # useful if filtering by email + ext_id => 9999, # ext_id from message sender + email => 'jdoe@example.com', # e-mail of message sender + bounced => 0, # true if message is bounce + date => '2005-08-24 18:57:24', # date of receival in ISO format } @@ -1155,37 +1155,54 @@ } } -=head1 UNIMPLEMENTED FUNCTIONS - -This is a stub for documentation of unimplemented functions. - =head2 MessagesReceived +Return statistics about received messages. + my @result = MessagesReceived( list => 'My list', email => 'jdoe@example.com', ); -You can specify just C or C or any combination of those. +You must specify C or C or any combination of those. For format of returned array element see C. +=cut + +sub MessagesReceived { + my $self = shift; + + if ($_[0] !~ m/^HASH/) { + die "need both list and email" unless (scalar @_ < 2); + return $nos->received_messages( + list => $_[0], email => $_[1], + ); + } else { + my $arg = {@_}; + die "need both list and email" unless ($arg->{'list'} && $arg->{'email'}); + return $nos->received_messages( $arg ); + } +} + +### + +=head1 UNIMPLEMENTED SOAP FUNCTIONS + +This is a stub for documentation of unimplemented functions. + =head2 MessagesReceivedByDate =head2 MessagesReceivedByDateWithContent -=head2 ReceivedMessasgeContent +=head2 ReceivedMessageContent Return content of received message. my $mail_body = ReceivedMessageContent( id => 42 ); -=cut - - -### =head1 NOTE ON ARRAYS IN SOAP