rh_instance(0);
my $res = $rh->_get('https://jsonplaceholder.typicode.com/todos/1');
isa_ok($res, 'Mojo::Message::Response');
is($res->json->{title}, 'delectus aut autem', '_post(...) work
ken_type, $s->oauth2_token->access_token
)
: ()
} => json => \%data
);
return $s->_options($url, %data)
if $retval->res->code == 401 && $s-
rh_instance(0);
my $res = $rh->_options('https://jsonplaceholder.typicode.com/');
isa_ok($res, 'Mojo::Message::Response');
is($res->json, ());
}
sub _post ($s, $url, %data) {
#warn 'POST
_rh => $s->_rh,
%{$s->_rh->_get($s->{instrument})->json}
);
}
=head1 LEGAL
This is a simple wrapper around the API used in the official apps. The a
od::User->new(_rh => $s->_rh, %{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_user {
t::Utility
s_success
? $res->json->{can_downgrade_to_cash}
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_can_downgr
h
= t::Utility::stash('ACCT')->can_downgrade_to_cash;
isa_ok($can_downgrade_to_cash, 'JSON::PP::Boolean');
}
=head2 C<instant_eligibility( )>
Returns the related Finance::Robinhood::Equi
%{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_instrument {
t::U
es->json)
if !$res->is_success;
}
return $res->is_success ||
Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
%{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_add_instrument {
, uuids => join ',', @ids);
return $res->is_success || Finance::Robinhood::Error->new(%{$res->json});
}
sub _test_reorder {
t::Utility::stash('WATCHLIST') // skip_all();
t::Utility::stash
%{$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_quote {
t::Utilit
%{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_prices {
t::Utili
%{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_market {
my $rh
%{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_instrument {
t::U
od::User->new(_rh => $s->_rh, %{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_user {
t::Utility
%{$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
%{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_position {
t::Uti
e::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
=head2 C<created_at( )>
Returns a Time::Moment object.
=cut
sub created_at ($s) {
Tim
%{$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
%{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_todays_hours {
t:
%{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_hours {
t::Utilit
%{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_submit {
t::Utili
e::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
=head2 C<updated_at( )>
Returns a Time::Moment object.
=cut
sub updated_at ($s) {
Tim
od::User->new(_rh => $s->_rh, %{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_user {
t::Utility
%{$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_next_open_hours {
%{$res->json})
: Finance::Robinhood::Error->new(
$res->is_server_error ? (details => $res->message) : $res->json);
}
sub _test_previous_open_hours {
%{$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