AnyEvent-SparkBot

 view release on metacpan or  search on metacpan

lib/AnyEvent/HTTP/Spark.pm  view on Meta::CPAN

package AnyEvent::HTTP::Spark;

use Modern::Perl;
use Moo;
use MooX::Types::MooseLike::Base qw(:all);
use Data::Dumper;
use JSON qw(to_json from_json);
use HTTP::Request::Common qw(POST);
use Ref::Util qw(is_plain_arrayref is_plain_hashref);
use URI::Escape qw(uri_escape_utf8);
use namespace::clean;
use Scalar::Util qw(looks_like_number);
use AnyEvent;

BEGIN { 
  no namespace::clean;
  with 'HTTP::MultiGet::Role','Log::LogMethods','AnyEvent::SparkBot::SharedRole';
}

has api_url=>(
  isa=>Str,
  is=>'ro',
  lazy=>1,
	#default=>'https://api.ciscospark.com/v1/',
	default=>'https://webexapis.com/v1/',
);

has retryCount=>(
  isa=>Int,
  is=>'ro',
  default=>1,
);

has retryTimeout=>(
  isa=>Int,
	is=>'ro',
	default=>1,
);

has retryAfter=>(
  isa=>Int,
  is=>'ro',
  default=>10,
);

has retries=>(
  isa=>HashRef,
  is=>'ro',
  default=>sub { return {} },
);

=head1 NAME

AnyEvent::HTTP::Spark - Syncrnous/Asyncrnous HTTP Rest Client for Cisco Spark

=head1 SYNOPSIS

  use AnyEvent::HTTP::Spark;
  my $obj=new AnyEvent::HTTP::Spark(token=>$ENV{SPARK_TOKEN});

=head1 DESCRIPTION

Dual Nature Syncrnous/Asyncrnous AnyEvent friendly Spark v1 HTTP Client library.

=head1 Moo Roles Used

This class uses the following Moo Roles

  HTTP::MultiGet::Role

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.895 second using v1.00-cache-2.02-grep-82fe00e-cpan-1925d2aa809 )