Apigee-Edge
view release on metacpan or search on metacpan
lib/Apigee/Edge/Helper.pm view on Meta::CPAN
for my $app (@{$apps->{app}}) {
next unless $app->{status} eq 'approved';
my $consumerKey = eval {
my $credentials = $app->{credentials};
$credentials->[0]->{consumerKey};
} || next;
if (my $attrs = $app->{attributes}) {
my %attrs = map { $_->{name} => $_->{value} } @$attrs;
$app->{name} = $attrs{DisplayName} if $attrs{DisplayName};
}
$CLIENTS->{$consumerKey} = $app->{name};
}
return $CLIENTS;
}
1;
__END__
=encoding utf-8
=head1 NAME
Apigee::Edge::Helper - Helpers for Apigee::Edge
=head1 SYNOPSIS
use Apigee::Edge::Helper;
my $apigee = Apigee::Edge::Helper->new(
org => 'apigee_org',
usr => 'your_email',
pwd => 'your_password'
);
=head1 DESCRIPTION
it builts top on L<Apigee::Edge> with same useful helpers.
=head1 METHODS
=head2 get_top_developer_app
my $app = $apigee->get_top_developer_app($email);
get the first app belongs to developer ($email) and flatten attrs into app
=head2 refresh_developer_app
my $app = $apigee->refresh_developer_app(
app => $old_app, # optional, app hashref, can be from get_top_developer_app
email => $client_email,
name => $name,
callbackUrl => $callback_url,
apiProducts => ['ProductName'], # optional
firstName => $first_name,
lastName => $last_name,
userName => $loginid,
);
warn $apigee->errstr;
when param B<app> is provided, we'll update the $old_app to $app with name to be a DisplayName attr and callbackUrl updated..
when param B<app> is not provided, we'll first call get_top_developer_app to find the app to update. if app is not created yet, we'll create a new developer on the fly with email/firstName/lastName/userName and created related developer_app with name...
=head2 get_all_clients
my $clients = $apigee->get_all_clients();
with consumerKey as key and DisplayName || name as the value.
=head2 errstr
=head1 GITHUB
L<https://github.com/binary-com/perl-Apigee-Edge>
=head1 AUTHOR
Binary.com E<lt>fayland@binary.comE<gt>
=head1 COPYRIGHT
Copyright 2014- Binary.com
=head1 LICENSE
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=head1 SEE ALSO
=cut
( run in 1.589 second using v1.01-cache-2.11-cpan-39bf76dae61 )