Subject: | Fwd: getAllNicknames() always fail in v1.1.6 |
Date: | Thu, 22 Oct 2009 16:28:36 +0200 |
To: | bug-REST-Google-Apps-Provisioning [...] rt.cpan.org |
From: | Zrajm C Akfohg <zrajm [...] klingonska.org> |
I re-wrote getAllNicknames() by copy-pasting and reducing
getNickname() -- and this works:
sub getAllNicknames {
my $self = shift;
my $url = qq(https://apps-apis.google.com/a/feeds/$self->{'domain'}/nickname/2.0/);
my $result = $self->_request( 'method' => 'GET', 'url' => $url )
|| return( 0 );
my ( $ref, $nickname );
foreach ( keys %{$result->{'entry'}} ) {
$nickname = $1 if /^.*\/(.+)$/;
$ref->{$nickname} = {
%{$result->{'entry'}->{$_}->{'apps:login'}},
%{$result->{'entry'}->{$_}->{'apps:nickname'}}
}
}
return( $ref );
}
Show quoted text
---------- Forwarded message ----------
From: Zrajm C Akfohg <zrajm@klingonska.org>
Date: Thu, Oct 22, 2009 at 15:43
Subject: getAllNicknames() always fail in v1.1.6
To: bug-REST-Google-Apps-Provisioning@rt.cpan.org
Calling getAllNicknames() always gives the error message "Missing
required 'nickname' argument".
Looking into the code, the problem is obvious. getAllNicknames() is
defined as follows:
sub getAllNicknames { return shift->getNickname(); }
And getNickname() in turn checks to make sure that it's given at least
one "nickname" argument, croaking otherwise.
If I comment out this check, getAllNicknames() gives a warning,
returns all nicknames, as expected.
# foreach my $param ( qw/ nickname / ) {
# $arg->{$param} || croak( "Missing required '$param' argument"
);
# }
/zrajm