'((mon\S*)|(tue\S*)|(wed\S*)|(thu\S*)|(fri\S*)|(sat\S*)|(sun\S*))',
_HYPHEN => '(-)',
_JSON => '(\{[^\{]*\})',
_MONTH => '((jan\S*)|(feb\S*)|(mar\S*)|(apr\S*)|(may\S*)|(jun\S*)|(
s->[0];
return [ $method, "interval/fillup", $th->{_REST} ];
}
# $METHOD interval iid $IID $JSON
sub _method_interval_iid {
my ( $ts, $th ) = @_;
my $method = $ts->[0];
my $iid = $th
loyee rest_error );
use Data::Dumper;
use Exporter 'import';
use File::Slurp;
use File::Temp;
use JSON;
use Web::MREST::CLI qw( send_req );
=head1 NAME
App::Dochazka::CLI::Shared - Shared routine
dule code (scode): " . $scode . "\n";
}
# decode the schedule
my $sch_array = decode_json( $sch->schedule );
foreach my $entry ( @$sch_array ) {
$ps .= ' 'x$ARGS{'indent'} if
atus->payload );
}
=head2 generate_report
GENERATE REPORT _PATH $PARAMETERS_JSON
Example $PARAMETERS_JSON: { "name" : "John Doe" }
=cut
sub generate_report {
print "Entering " . __PA
= $th->{_PATH};
my $entity = "{ \"path\": \"$path\"";
$entity .= ", \"parameters\": " . $th->{_JSON} if $th->{_JSON};
$entity .= " }";
return shared_generate_report( $entity );
}
1;
_test );
use App::Dochazka::Common::Model::Schedule;
use Data::Dumper;
use Exporter 'import';
use JSON;
use Web::MREST::CLI qw( send_req );
=head1 NAME
App::Dochazka::CLI::Commands::Schedule - Sc
->{'scode'} = $memsched_scode if $memsched_scode;
my $json = encode_json $sched;
my $status = send_req( 'POST', 'schedule/new', $json );
if ( $status->ok ) {
my $sch_obj = App::Do
Model::Interval;
use Data::Dumper;
use Date::Calc qw( Days_in_Month );
use Exporter 'import';
use JSON;
use Params::Validate qw( :all );
use Text::Table;
use Web::MREST::CLI qw( send_req );
=head1
range,
};
$entity_perl->{'long_desc'} = $long_desc if $long_desc;
my $entity = encode_json $entity_perl;
# send the request
$status = send_req( 'POST', "interval/new", $entity );
"employee" : $EMPLOYEE_OBJECT_JSON,
"tsrange" : "$TSRANGE"
}
}
=cut
sub _interval_report {
my ( $emp, $tsr ) = @_;
my $emp_json = JSON->new->convert_blessed->encode(
tivity aid $JSON
sub _method_activity_aid {
my ( $ts, $th ) = @_;
my $method = $ts->[0];
return [ $method, "activity/aid", $th->{_JSON} ];
}
# $METHOD activity aid $AID [$JSON]
sub _meth
ity code $JSON
sub _method_activity_code {
my ( $ts, $th ) = @_;
my $method = $ts->[0];
return [ $method, "activity/code", $th->{_JSON} ];
}
# $METHOD activity code $CODE [$JSON]
sub _me
];
}
# $METHOD employee eid $JSON
sub _method_employee_eid_json {
my ( $ts, $th ) = @_;
my $method = $ts->[0];
return [ $method, "employee/eid", $th->{_JSON} ];
}
# $METHOD employee eid
$JSON
sub _method_employee_eid_num_json {
my ( $ts, $th ) = @_;
my $method = $ts->[0];
my $eid = $th->{_NUM};
my $json = $th->{_JSON};
return [ $method, "employee/eid/$eid", $json
}
# $METHOD employee nick $JSON
sub _method_employee_nick_json {
my ( $ts, $th ) = @_;
my $method = $ts->[0];
return [ $method, "employee/nick", $th->{_JSON} ];
}
# $METHOD employee ni
( $emp_spec->can('eid') ) {
$status = $CELL->status_ok( 'DUMMY', payload => $emp_spec->TO_JSON );
} elsif ( ref( $emp_spec ) eq '' ) {
$status = lookup_employee( key => $emp_spec )
TIVITY AID _JSON" => \&_method_activity_aid,
"PUT ACTIVITY AID _JSON" => \&_method_activity_aid,
"POST ACTIVITY AID _JSON" => \&_method_activity_aid,
"DELETE ACTIVITY AID _JSON" => \&_meth
TY CODE _JSON" => \&_method_activity_code,
"PUT ACTIVITY CODE _JSON" => \&_method_activity_code,
"POST ACTIVITY CODE _JSON" => \&_method_activity_code,
"DELETE ACTIVITY CODE _JSON" => \&_m
EID _JSON" => \&_method_employee_eid_json,
"PUT EMPLOYEE EID _JSON" => \&_method_employee_eid_json,
"POST EMPLOYEE EID _JSON" => \&_method_employee_eid_json,
"DELETE EMPLOYEE EID _JSON" =>