%{$res->json}
) if $res->is_success;
Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_pair_ids
x::Order->new(_rh => $s->_rh, %{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_submit {
t::Utili
ew(@_);
}
=item new
Create new error instance from options, e.g. from a (decoded dereferenced) JSON response.
Arguments are handled by C<set_error>.
=cut
sub new
{
my $this = shift;
my $
p;
#ddx $res;
#ddx $res->json;
#die;
if ($res->is_success) {
my $json = $res->json;
$s->_next_page($json->{next});
push @push, map {
}
: $_
: ()
} @{$json->{results}};
}
else { # Trouble! Let's not try another page
$s->_n
x::Quote->new(_rh => $s->_rh, %{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_quote {
t::Utilit
%{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_historicals {
t::
bless $self, $class;
return $self;
};
=item post_data
Return the RPC::POST hashref (no JSON encoding).
Returns undef if the id is not defined.
=cut
sub post_data
{
my $self = shift;
%{$res->json->{challenge}}
)
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
=head2 C<sms( )>
%{$res->json->{challenge}}
)
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
=head2 C<respond( ..
%{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
=head1 LEGAL
This is a simple
package Net::FreeIPA;
# dzil abstract
# ABSTRACT: Net::FreeIPA is a perl FreeIPA JSON API client class
$Net::FreeIPA::VERSION = '3.0.3';
use strict;
use warnings;
use Net::FreeIPA::DummyLogger;
use
t::FreeIPA::API
Net::FreeIPA::Common);
=head1 NAME
Net::FreeIPA is a perl FreeIPA JSON API client class
=head1 SYNOPSIS
'ipa user-find' equivalent using API call and basic result pos
rror/warn/info/debug methods)
(e.g. L<LOG::Log4perl>).
=item debugapi
When true, log the JSON POST and JSON reply data with debug.
=back
All other arguments and options are passed to L<Net::FreeIP
%{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_account {
t::Util
ict;
use warnings;
use Readonly;
use Data::Dumper;
use Log::Log4perl qw(get_logger :levels);
use JSON::XS;
BEGIN {
unshift(@INC, 'lib');
};
use Net::FreeIPA;
use Net::FreeIPA::API;
use Template
ata.pm and Data.pod from JSON API
GEN_API_DEBUG=1 GEN_API_HOSTNAME=host.example.com ./gen_api/gen_api.pl
=head2 Functions
=over
=item get_api
Get the API from the JSON API.
Args/opts are pas
module_name => $MODULE_NAME,
script_name => $SCRIPT_NAME,
encode_json => sub { return encode_json(Net::FreeIPA::API::Magic::cache(shift));},
check_hash => sub {
%{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_next_open_hours {
%{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_previous_open_hours {
=pod
=head2 Generated API data version v2.230
=over
=cut
=item aci_add
JSON data for API method aci_add
Create new ACI.
=over
=item Required arguments
=over
=item aciname: ACI na
h C<__> are passed as options to C<Net::FreeIPA::RPC::rpc>.
=back
=back
=cut
=item aci_del
JSON data for API method aci_del
Delete ACI.
=over
=item Required arguments
=over
=item
C<__> are passed as options to C<Net::FreeIPA::RPC::rpc>.
=back
=back
=cut
=item aci_find
JSON data for API method aci_find
Search for ACIs.
Returns a list of ACIs
EXAMPLES:
I::Magic::VERSION = '3.0.3';
use strict;
use warnings;
use Types::Serialiser; # is used by JSON::XS
use JSON::XS;
use Net::FreeIPA::API::Data;
use Readonly;
use base qw(Exporter);
our @EXPORT_OK
shref, cache (and return) the relevant
(filtered) command data.
C<data> is typically the decoded JSON command response.
=cut
sub cache
{
my ($data) = @_;
my $name = $data->{name};
for
# Get the JSON data from Net::FreeIPA::API::Data
# TODO: get the JSON data from the JSON api
my $data;
my $json = $Net::FreeIPA::API::Data::API_DATA{$name};
if (! $json) {
s->_rh->_delete($s->{url});
return $res->is_success || Finance::Robinhood::Error->new(%{$res->json});
}
sub _test_delete {
t::Utility::stash('ELEMENT') // skip_all();
todo("Add something
s->_rh,
%{$res->json})
: Finance::Robinhood::Error->new(%{$res->json});
}
sub _test_instrument {
t::Utility::stash('ELEMENT') // skip
%{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_watchlist {
t::Ut
:FreeIPA::RPC::VERSION = '3.0.3';
use strict;
use warnings;
use Readonly;
use REST::Client;
use JSON::XS;
use Net::FreeIPA::Error;
use Net::FreeIPA::API::Magic;
use Net::FreeIPA::Request;
use Net::
only my $IPA_URL_LOGIN_KERBEROS => '/ipa/session/login_kerberos';
Readonly my $IPA_URL_JSON => '/ipa/session/json';
Readonly my $IPA_URL_REFERER => '/ipa';
=head1 NAME
Net::FreeIPA::RPC provides RPC
g("Successful login");
# prep JSON REST API
$rc->addHeader("Content-Type", "application/json");
$rc->addHeader("Accept", "applicaton/json");
$rc->addHeader('referer',
"v2.230");
use Readonly;
# Generated API data using Net::FreeIPA::API::cache
# All commands are JSON encoded.
Readonly our %API_DATA => {
aci_add => '{"takes_args":[{"required":true,"autof
se,"multivalue":false,"name":"version","type":"unicode","class":"Str"}],"name":"join"}',
json_metadata => '{"takes_args":[{"required":false,"autofill":false,"multivalue":false,"name":"objname
lse,"autofill":false,"multivalue":false,"name":"version","type":"unicode","class":"Str"}],"name":"json_metadata"}',
kra_is_enabled => '{"takes_args":[],"takes_options":[{"required":false,"aut
%{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_instrument {
t::U
%{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_instrument {
t::U
%{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_account {
t::Util
e::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
=head2 C<reload( )>
$order->reload();
Reloads the data for this order from the API ser
x::Order->new(_rh => $s->_rh, %{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_reload {
t::Utili
%{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_instrument {
t::U
%{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_account {
t::Util