es->code,message=>$res->message,body=>($res->body//''))->throw if $res->is_error;
my $j = $res->json; $token = $j->{access_token}; $refresh = $j->{refresh_token}//$refresh; $expires_at = time + ($j-
es->code,message=>$res->message,body=>($res->body//''))->throw if $res->is_error;
my $j = $res->json; $token = $j->{access_token}; $refresh = $j->{refresh_token}//$refresh; $expires_at = time + ($j-
ad) { $t->request('PATCH', "/products/$code", json => $payload) }
method upsert_ndjson ($records) { $t->request('PATCH', "/products", ndjson => $records) }
method list (%params)
ice::Akeneo::Resource::Categories::VERSION = '0.001';
use v5.38;
use Object::Pad;
use Mojo::JSON 'encode_json';
use Mojo::URL;
class WebService::Akeneo::Resource::Categories 0.001;
field $t :param;
f
{ $t->request('PATCH', "/categories/$code", json => $payload) }
method upsert_ndjson ($records) { $t->request('PATCH', "/categories", ndjson => $records) }
method list (%params)
}) // 100;
my $query = {
with_position => 'true',
limit => $limit,
search => encode_json({ parent => [ { operator => '=', value => $root_code } ] }),
};
my $acc = [];
my $path = '/
'0.001';
use v5.38;
use Object::Pad;
use Mojo::UserAgent;
use Mojo::URL;
use Mojo::JSON qw(encode_json decode_json);
use Time::HiRes 'sleep';
use WebService::Akeneo::HTTPError;
class WebService::
s = { Accept=>'application/json', Authorization => 'Bearer ' . $auth->bearer };
my $tx;
if (exists $opt{ndjson}) {
my $records = $opt{ndjson} // [];
die 'ndjson must be arrayref' unless r
;
die 'ndjson array empty' unless @$records;
my $ndjson = join("", map { encode_json($_)."\n" } @$records);
$headers->{'Content-Type'} = 'application/vnd.akeneo.collection+json';
$tx =