Group
Extension

Matches 35358

Taskwarrior-Hooks ( Y/YA/YANICK/Taskwarrior-Hooks-0.0.1.tar.gz, YANICK, 2017; MetaCPAN )
Taskwarrior-Hooks/lib/Taskwarrior/Kusarigama/Core.pm ( view source; MetaCPAN )
strict;
use warnings;

use Path::Tiny;

use Moo::Role;

use MooseX::MungeHas;

use IPC::Run3;
use JSON;
use Module::Runtime qw/ use_module /;
use List::AllUtils qw/ uniq /;

use experimental 'postdere
f export /, @query], undef, \my $out;

    return @{ from_json $out };
}


sub import_task {
    my( $self, $task ) = @_;

    my $in = to_json $task;

    run3 [qw/ task rc.recurrence=no import /], \
he tasks.

=head2 import_task

    $tw->import_task( \%task  )

Equivalent to

    $ task import <json representation of %task>

=head2 calc

    $result = $tw->calc( qw/ today + 3d / );

Equivalent t
Chouette ( F/FR/FRACTAL/Chouette-0.102.tar.gz, FRACTAL, 2017; MetaCPAN )
Chouette/lib/Chouette/Context.pm ( view source; MetaCPAN )
;

use common::sense;

use Plack::Request::WithEncoding;
use Plack::Response;
use Log::Defer;
use JSON::XS;
use Data::Dumper;


sub new {
    my ($class, %args) = @_;

    my $self = \%args;
    bless
 eval { encode_json($msg) };

        if ($@) {
            $encoded_msg = eval { encode_json(_json_clean($msg)) };

            if ($@) {
                $encoded_msg = "Failed to JSON clean: " . Dum
}) {
        $self->logger->warn("sending JSON error: $body->{error}");
    }

    return $self->respond_raw($http_code // 200, 'application/json', encode_json($body));
}



sub done {
    die shift->
Dancer2-Plugin-EditFile ( J/JA/JACKB/Dancer2-Plugin-EditFile-0.005.tar.gz, JACKB, 2017; MetaCPAN )
Dancer2-Plugin-EditFile/lib/Dancer2/Plugin/EditFile.pm ( view source; MetaCPAN )
   regexp => qr!$disp_route!,
    code   => \&display_editfile,
  );

  # Setup a route to return json data of the file
  my $save_route  = $plugin->save_route;
  my $save_method = $plugin->save_metho
 $@ ) {
      $status_message = "Could not write changes to file.";
    }
  }
  
  $app->send_as( JSON => { save_message => $status_message } );
}

=back


=head1 AUTHOR

Hagop "Jack" Bilemjian, C<< <
Taskwarrior-Hooks ( Y/YA/YANICK/Taskwarrior-Hooks-0.0.1.tar.gz, YANICK, 2017; MetaCPAN )
Taskwarrior-Hooks/lib/Taskwarrior/Kusarigama/Hook.pm ( view source; MetaCPAN )

use Path::Tiny;
use Hash::Merge qw/merge /;
use List::AllUtils qw/ reduce pairmap pairmap /;
use JSON;

use experimental 'postderef';

with 'Taskwarrior::Kusarigama::Core';


has raw_args => (
    is
hod = join '_', 'run', $event;

    my @plugins = $self->plugins->@*;

    my @tasks = map { from_json($_) } <STDIN>;

    try {
        $self->$method(\@plugins,@tasks);
    }
    catch {
        say
on_add($task) for grep { $_->DOES('Taskwarrior::Kusarigama::Hook::OnAdd') } @$plugins;
    say to_json($task);
    say for $self->feedback->@*;
}


# TODO document the $old, $new, $diff

sub run_modif
Catmandu-Store-Resolver ( P/PI/PIETERDP/Catmandu-Store-Resolver-0.05.tar.gz, PIETERDP, 2017; MetaCPAN )
Catmandu-Store-Resolver/lib/Catmandu/Store/Resolver/Bag.pm ( view source; MetaCPAN )
package Catmandu::Store::Resolver::Bag;

use Moo;
use JSON;

use Catmandu::Sane;
use Catmandu::Store::Resolver::API;

with 'Catmandu::Bag';

has api => (is => 'lazy');

has pid => (is => 'rw');

sub _
Catmandu-CA ( P/PI/PIETERDP/Catmandu-CA-0.06.tar.gz, PIETERDP, 2017; MetaCPAN )
Catmandu-CA/lib/Catmandu/CA/API/Request.pm ( view source; MetaCPAN )
RSION = '0.06';

use strict;
use warnings;

use Moo;
use Catmandu::Sane;

use LWP::UserAgent;
use JSON;

use Catmandu::CA::API::Login;

has url       => (is => 'ro', required => 1);
has url_query => (
;
    my $response = $self->ua->get($url);
    if ($response->is_success) {
        return decode_json($response->decoded_content);
    } elsif ($response->code == 404) {
        return {};
    } else
f->token);
    my $response = $self->ua->put($url, Content => $data, Content_type => 'application/json');

    if (!$response->is_success) {
        Catmandu::HTTPError->throw({
                code  
Nagios-Plugin-CheckHost ( U/UN/UNDEF/Nagios-Plugin-CheckHost-0.05.tar.gz, UNDEF, 2017; MetaCPAN )
Nagios-Plugin-CheckHost/lib/Net/CheckHost.pm ( view source; MetaCPAN )
package Net::CheckHost;

use strict;
use warnings;

our $VERSION = 0.05;

use JSON;
use LWP::UserAgent;
use URI;

sub new {
    my ($class, @args) = @_;

    bless {
        gateway   => 'https://chec
gin::CheckHost v' . $VERSION,
            'Content-Type' => 'application/json',
            'Accept'       => 'application/json',
        ]
    );
}

sub request {
    my $self = shift;

    my $http_
($http_response->status_line)
      unless $http_response->is_success;

    my $response = decode_json($http_response->decoded_content);

    if ($response->{error}) {
        my $error = $response->{
Armadito-Agent ( V/VH/VHAMON/Armadito-Agent-0.10.1.tar.gz, VHAMON, 2017; MetaCPAN )
Armadito-Agent/lib/Armadito/Agent/Task/Runjobs.pm ( view source; MetaCPAN )
ent::Task';

use Armadito::Agent::Storage;
use Data::Dumper;
use MIME::Base64;
use Try::Tiny;
use JSON;

sub new {
	my ( $class, %params ) = @_;

	my $self = $class->SUPER::new(%params);

	if ( $param
se ) = @_;

	$self->{logger}->info( "Error Response : " . $response->content() );
	my $obj = from_json( $response->content(), { utf8 => 1 } );
	$self->{logger}->error( Dumper($obj) );

	return $self;
 = @_;

	my $json_text = to_json( $self->{jobj} );

	my $response = $self->{glpi_client}->sendRequest(
		"url"   => $self->{agent}->{config}->{server}[0] . "/api/jobs",
		message => $json_text,
		meth
WWW-Shorten-Yourls ( C/CA/CAPOEIRAB/WWW-Shorten-Yourls-1.001.tar.gz, CAPOEIRAB, 2017; MetaCPAN )
WWW-Shorten-Yourls/lib/WWW/Shorten/Yourls.pm ( view source; MetaCPAN )
ten::Yourls;

use strict;
use warnings;
use Carp ();
use File::HomeDir ();
use File::Spec ();
use JSON::MaybeXS;
use Path::Tiny qw(path);
use Scalar::Util qw(blessed);
use URI ();

use base qw( WWW::S
 password server signature),
        ];
        return [@{$attrs}];
    }
}

# _json_request (static, private)
sub _json_request {
    my $url = shift;
    Carp::croak("Invalid URI object") unless $ur
ation/json}) {
        Carp::croak("Unexpected response: $content");
    }
    my $json = decode_json($content);
    Carp::croak("Invalid data returned: $content") unless $json;
    return $json;
}

#
Armadito-Agent ( V/VH/VHAMON/Armadito-Agent-0.10.1.tar.gz, VHAMON, 2017; MetaCPAN )
Armadito-Agent/lib/Armadito/Agent/Task/Enrollment.pm ( view source; MetaCPAN )
e 'Armadito::Agent::Task';
use Armadito::Agent::Tools::File qw( readFile );
use Data::Dumper;
use JSON;

sub new {
	my ( $class, %params ) = @_;

	my $self = $class->SUPER::new(%params);

	if ( $param


	$self = $self->SUPER::run(%params);

	$self->_setEnrollmentKey();

	my $json_text = to_json( $self->{jobj} );
	print $json_text. "\n";

	my $response = $self->{glpi_client}->sendRequest(
		"url"   
 : " . $response->content() . "\n" );
	if ( $response->content() =~ /^\s*\{/ ) {
		my $obj = from_json( $response->content(), { utf8 => 1 } );
		$self->{logger}->error( $obj->{message} );
	}
	return $
Armadito-Agent ( V/VH/VHAMON/Armadito-Agent-0.10.1.tar.gz, VHAMON, 2017; MetaCPAN )
Armadito-Agent/lib/Armadito/Agent/Antivirus/Armadito/Task/State.pm ( view source; MetaCPAN )
:Task:State>. Ask for Armadito Antivirus state using AV's API REST protocol and then send it in a json formatted POST request to Armadito plugin for GLPI.

=head1 FUNCTIONS

=head2 run ( $self, %param
Armadito-Agent ( V/VH/VHAMON/Armadito-Agent-0.10.1.tar.gz, VHAMON, 2017; MetaCPAN )
Armadito-Agent/lib/Armadito/Agent/Antivirus/Armadito/Task/Scan.pm ( view source; MetaCPAN )
 Armadito Antivirus on-demand scan using AV's API REST protocol and then send a brief report in a json formatted POST request to Armadito plugin for GLPI.

=head1 FUNCTIONS

=head2 run ( $self, %param
Armadito-Agent ( V/VH/VHAMON/Armadito-Agent-0.10.1.tar.gz, VHAMON, 2017; MetaCPAN )
Armadito-Agent/lib/Armadito/Agent/Antivirus/Armadito.pm ( view source; MetaCPAN )
rmadito module. Set task's default logger.

=head2 getJobj ( $self )

Return unblessed object for json ecnapsulation.

=head2 getVersion ( $self )

Return Antivirus Version by using RESTful API /versi
Armadito-Agent ( V/VH/VHAMON/Armadito-Agent-0.10.1.tar.gz, VHAMON, 2017; MetaCPAN )
Armadito-Agent/lib/Armadito/Agent/Antivirus/Armadito/Task/Alerts.pm ( view source; MetaCPAN )
ask inherits from L<Armadito::Agent::Task:Alerts>. Get Armadito Antivirus alerts and send them as json messages to armadito glpi plugin.

=head1 FUNCTIONS

=head2 run ( $self, %params )

Run the task.
Armadito-Agent ( V/VH/VHAMON/Armadito-Agent-0.10.1.tar.gz, VHAMON, 2017; MetaCPAN )
Armadito-Agent/lib/Armadito/Agent/Task/Getjobs.pm ( view source; MetaCPAN )
 warnings;
use base 'Armadito::Agent::Task';

use Armadito::Agent::Storage;
use Data::Dumper;
use JSON;

sub new {
	my ( $class, %params ) = @_;

	my $self = $class->SUPER::new(%params);

	if ( $param
= @_;

	$self->{logger}->info( "Successful Response : " . $response->content() );
	my $obj = from_json( $response->content(), { utf8 => 1 } );

	if ( defined( $obj->{jobs} ) && ref( $obj->{jobs} ) eq 
se ) = @_;

	$self->{logger}->info( "Error Response : " . $response->content() );
	my $obj = from_json( $response->content(), { utf8 => 1 } );
	$self->{logger}->error( Dumper($obj) );

	return $self;
Armadito-Agent ( V/VH/VHAMON/Armadito-Agent-0.10.1.tar.gz, VHAMON, 2017; MetaCPAN )
Armadito-Agent/lib/Armadito/Agent/Task/Scheduler.pm ( view source; MetaCPAN )
 strict;
use warnings;
use base 'Armadito::Agent::Task';

use MIME::Base64;
use Data::Dumper;
use JSON;

sub new {
	my ( $class, %params ) = @_;

	my $self = $class->SUPER::new(%params);

	if ( $param
se ) = @_;

	$self->{logger}->info( "Error Response : " . $response->content() );
	my $obj = from_json( $response->content(), { utf8 => 1 } );
	$self->{logger}->error( Dumper($obj) );

	return $self;
fos;
	my $json_text = to_json( $self->{jobj} );

	my $response = $self->{glpi_client}->sendRequest(
		"url"   => $self->{agent}->{config}->{server}[0] . "/api/schedulers",
		message => $json_text,
		m
Armadito-Agent ( V/VH/VHAMON/Armadito-Agent-0.10.1.tar.gz, VHAMON, 2017; MetaCPAN )
Armadito-Agent/lib/Armadito/Agent/Task/State.pm ( view source; MetaCPAN )
:Task::State;

use strict;
use warnings;
use base 'Armadito::Agent::Task';

use Data::Dumper;
use JSON;

sub new {
	my ( $class, %params ) = @_;

	my $self = $class->SUPER::new(%params);

	if ( $param
teobj;
	my $json_text = to_json( $self->{jobj} );

	my $response = $self->{glpi_client}->sendRequest(
		"url"   => $self->{agent}->{config}->{server}[0] . "/api/states",
		message => $json_text,
		met
se ) = @_;

	$self->{logger}->info( "Error Response : " . $response->content() );
	my $obj = from_json( $response->content(), { utf8 => 1 } );
	$self->{logger}->error( Dumper($obj) );

	return $self;
Armadito-Agent ( V/VH/VHAMON/Armadito-Agent-0.10.1.tar.gz, VHAMON, 2017; MetaCPAN )
Armadito-Agent/lib/Armadito/Agent/Task/Alerts.pm ( view source; MetaCPAN )
e Armadito::Agent::Task::Alerts;

use strict;
use warnings;
use base 'Armadito::Agent::Task';
use JSON;
use Data::Dumper;

sub new {
	my ( $class, %params ) = @_;

	my $self = $class->SUPER::new(%para
se ) = @_;

	$self->{logger}->info( "Error Response : " . $response->content() );
	my $obj = from_json( $response->content(), { utf8 => 1 } );
	$self->{logger}->error( Dumper($obj) );

	return $self;
my $json_text = to_json( $self->{jobj} );
	$self->{logger}->debug($json_text);

	my $response = $self->{glpi_client}->sendRequest(
		"url"   => $self->{glpi_url} . "/api/alerts",
		message => $json_te
Armadito-Agent ( V/VH/VHAMON/Armadito-Agent-0.10.1.tar.gz, VHAMON, 2017; MetaCPAN )
Armadito-Agent/lib/Armadito/Agent/Task/AVConfig.pm ( view source; MetaCPAN )
Armadito::Agent::Task::AVConfig;

use strict;
use warnings;
use base 'Armadito::Agent::Task';
use JSON;
use Data::Dumper;

sub new {
	my ( $class, %params ) = @_;

	my $self = $class->SUPER::new(%para
se ) = @_;

	$self->{logger}->info( "Error Response : " . $response->content() );
	my $obj = from_json( $response->content(), { utf8 => 1 } );
	$self->{logger}->error( Dumper($obj) );

	return $self;
 $json_text = to_json( $self->{jobj} );
	$self->{logger}->debug($json_text);

	my $response = $self->{glpi_client}->sendRequest(
		"url"   => $self->{glpi_url} . "/api/avconfigs",
		message => $json_t
WebService-Reddit ( O/OA/OALDERS/WebService-Reddit-0.000003.tar.gz, OALDERS, 2017; MetaCPAN )
WebService-Reddit/lib/WebService/Reddit/Response.pm ( view source; MetaCPAN )
:Reddit::Response;
$WebService::Reddit::Response::VERSION = '0.000003';
use Moo;

use JSON::MaybeXS qw( decode_json );
use Types::Standard qw( Bool InstanceOf Maybe HashRef );

has content => (
    is
my $self    = shift;
    my $content = $self->raw->decoded_content;

    return $content ? decode_json($content) : undef;
}

sub _build_success {
    my $self = shift;
    return $self->raw->is_succes
item raw

An L<HTTP::Response> object.

=back

=head1 METHODS

=head2 content

This is the parsed JSON body of the response.  Generally this will be a C<HashRef>.

=head2 raw

Returns the raw L<HTTP::

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.