view release on metacpan or search on metacpan
lib/API/Octopart.pm view on Meta::CPAN
# You should have received a copy of the GNU General Public License along with
# this module. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright (C) 2022- eWheeler, Inc. L<https://www.linuxglobal.com/>
# Originally written by Eric Wheeler, KJ7LNW
# All rights reserved.
#
# All tradmarks, product names, logos, and brands are property of their
# respective owners and no grant or license is provided thereof.
#
package API::Octopart;
$VERSION = 1.003;
lib/API/Octopart.pm view on Meta::CPAN
User Agent debugging. This is very verbose and provides API communication details.
=item * json_debug => 1
JSON response debugging. This is very verbose and dumps the Octopart response
in JSON.
=back
=cut
lib/API/Octopart.pm view on Meta::CPAN
This is the max MOQ you will accept as being in
stock. For example, a 5000-part reel might be more
than you want for prototyping so set this to 10 or
100.
=item * seller => <regex> - Seller's name (regular expression)
This is a regular expression so something like
'Mouser|Digi-key' is valid.
=item * mfg => <regex> - Manufacturer name (regular expression)
Specifying the mfg name is useful if your part model
number is similar to those of other manufacturers.
=item * currency => <s> - eg, 'USD' for US dollars
lib/API/Octopart.pm view on Meta::CPAN
sub get_part_stock
{
my ($self, $part, %opts) = @_;
my $results = $self->get_part_stock_detail($part, %opts);
my %ret;
foreach my $result (@$results)
{
my $sellers = $result->{sellers};
foreach my $s (keys %$sellers)
{
$ret{$s} = $sellers->{$s};
delete $ret{$s}->{price_tier};
}
lib/API/Octopart.pm view on Meta::CPAN
'leadfree' => 'Lead Free',
'length' => '2mm',
'numberofpins' => '2',
'radiationhardening' => 'No',
'reachsvhc' => 'No SVHC',
'resistance' =>
"10k\x{ce}\x{a9}", # <- That is an Ohm symbol
'rohs' => 'Compliant',
'tolerance' => '1%',
'voltagerating_dc_' => '150V',
'width' => '1.25mm',
lib/API/Octopart.pm view on Meta::CPAN
}
=item * $o->octo_query($q) - Queries the Octopart API
Return the JSON response structure as a perl ARRAY/HASH given a query meeting Octopart's
API specification.
=cut
sub octo_query
lib/API/Octopart.pm view on Meta::CPAN
return;
}
);
$ua->add_handler(
"response_done",
sub {
my $msg = shift; # HTTP::Response
print STDERR "RECV << \n"
. $msg->headers->as_string . "\n"
. $msg->status_line . "\n"
lib/API/Octopart.pm view on Meta::CPAN
}
);
}
my $req;
my $response;
my $tries = 0;
while ($tries < 3)
{
$req = HTTP::Request->new('POST' => 'https://octopart.com/api/v4/endpoint',
lib/API/Octopart.pm view on Meta::CPAN
'DNT' => 1,
'Origin' => 'https://octopart.com',
),
encode_json( { query => $q }));
$response = $ua->request($req);
if (!$response->is_success)
{
$tries++;
print STDERR "query error, retry $tries. "
. $response->code . ": "
. $response->message . "\n";
sleep 2**$tries;
}
else
{
last;
}
}
$content = $response->decoded_content;
if (!$response->is_success) {
die "request: " . $req->as_string . "\n" .
"resp: " . $response->as_string;
}
}
my $j = from_json($content);
lib/API/Octopart.pm view on Meta::CPAN
return $self->{api_queries};
}
=item * $o->query_part_detail($part)
Return the JSON response structure as a perl ARRAY/HASH given a part search term
shown as "$part". This function calls $o->octo_query() with a query from Octopart's
"Basic Example" so you can easily lookup a specific part number. The has_stock()
and get_part_stock_detail() methods use this query internally.
=cut
lib/API/Octopart.pm view on Meta::CPAN
}
return $self->octo_query( qq(
query {
search(q: "$part", limit: 3) {
results {
part {
manufacturer {
name
}
mpn
lib/API/Octopart.pm view on Meta::CPAN
}
our %_valid_filter_opts = ( map { $_ => 1 } (qw/currency max_moq min_qty max_price mfg seller/) );
sub _parse_part_stock
{
my ($self, $resp, %opts) = @_;
foreach my $o (keys %opts)
{
die "invalid filter option: '$o'" if (!$_valid_filter_opts{$o});
}
my @results;
foreach my $r (@{ $resp->{data}{search}{results} })
{
$r = $r->{part};
my %part;
$part{mfg} = $r->{manufacturer}{name};
lib/API/Octopart.pm view on Meta::CPAN
}
}
$part{sellers} = \%ss;
push @results, \%part;
}
# Delete sellers that do not meet the constraints and
# add matching results to @ret:
my @ret;
foreach my $r (@results)
{
next if (defined($opts{mfg}) && $r->{mfg} !~ /$opts{mfg}/i);
foreach my $s (keys %{ $r->{sellers} })
{
lib/API/Octopart.pm view on Meta::CPAN
L<https://octopart.com/>, L<https://octopart.com/api>
=head1 ATTRIBUTION
Octopart is a registered trademark and brand of Octopart, Inc. All tradmarks,
product names, logos, and brands are property of their respective owners and no
grant or license is provided thereof.
The copyright below applies to this software module; the copyright holder is
unaffiliated with Octopart, Inc.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/ParallelsWPB.pm view on Meta::CPAN
use Carp;
use API::ParallelsWPB::Response;
use base qw/ API::ParallelsWPB::Requests /;
# ABSTRACT: client for Parallels Presence Builder API
our $VERSION = '0.03'; # VERSION
our $AUTHORITY = 'cpan:IMAGO'; # AUTHORITY
lib/API/ParallelsWPB.pm view on Meta::CPAN
}
$post_data = $self->_json->encode($data->{post_data});
}
$post_data ||= '{}';
my $response = $self->_send_request($data, $url, $post_data);
return $response;
}
sub _send_request {
my ( $self, $data, $url, $post_data ) = @_;
lib/API/ParallelsWPB.pm view on Meta::CPAN
$ua->ssl_opts( verify_hostname => 0 );
$ua->timeout( $self->{timeout} );
warn $req->as_string if ( $self->{debug} );
my $res = $ua->request( $req );
warn $res->as_string if ( $self->{debug} );
my $response = API::ParallelsWPB::Response->new( $res );
return $response;
}
sub _json {
my ( $self ) = @_;
lib/API/ParallelsWPB.pm view on Meta::CPAN
=encoding UTF-8
=head1 NAME
API::ParallelsWPB - client for Parallels Presence Builder API
=head1 VERSION
version 0.03
=head1 SYNOPSIS
my $client = API::ParallelsWPB->new( username => 'admin', password => 'passw0rd', server => 'builder.server.mysite.ru' );
my $response = $client->get_sites_info;
if ( $response->success ) {
for my $site ( @{ $response->response } ) {
say "UUID: ". $site->{uuid};
}
}
else {
warn "Error occured: " . $response->error . ", Status: " . $response->status;
}
=head1 METHODS
=head2 B<new($class, %param)>
lib/API/ParallelsWPB.pm view on Meta::CPAN
=over
=item username
Username for connection to Parallels WebPresence Builder instance. Required parameter.
=item password
Password for connection to Parallels WebPresence Builder instance. Required parameter.
=item server
Servername or server ip address for connection to Parallels WebPresence Builder instance. Optional parameter.
=item api_version
API version, used in API url constructing. Optional parameter.
lib/API/ParallelsWPB.pm view on Meta::CPAN
req_type : HTTP request type: get, post, put, delete. GET by default.
post_data: data for POST request. Must be hashref.
=head1 SEE ALSO
L<Parallels Presence Builder Guide|http://download1.parallels.com/WPB/Doc/11.5/en-US/online/presence-builder-standalone-installation-administration-guide>
L<API::ParallelsWPB::Response>
L<API::ParallelsWPB::Requests>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/Plesk.pm view on Meta::CPAN
$xml = $self->render_xml($xml);
warn "REQUEST $operator => $operation\n$xml" if $self->{debug};
my ($response, $error) = $self->xml_http_req($xml);
warn "RESPONSE $operator => $operation => $error\n$response" if $self->{debug};
unless ( $error ) {
$response = xml2hash $response, array => [$operation, 'result', 'property'];
}
return API::Plesk::Response->new(
operator => $operator,
operation => $operation,
response => $response,
error => $error,
);
}
sub bulk_send { confess "Not implemented!" }
lib/API/Plesk.pm view on Meta::CPAN
# LWP6 hack to prevent verification of hostname
$ua->ssl_opts(verify_hostname => 0) if $ua->can('ssl_opts');
warn $req->as_string if defined $self->{debug} && $self->{debug} > 1;
my $res = eval {
local $SIG{ALRM} = sub { die "connection timeout" };
alarm $self->{timeout};
$ua->request($req);
};
alarm 0;
warn $res->as_string if defined $self->{debug} && $self->{debug} > 1;
return ('', 'connection timeout')
if !$res || $@ || ref $res && $res->status_line =~ /connection timeout/;
return $res->is_success() ?
($res->content(), '') :
('', $res->status_line);
}
# renders xml packet for request
sub render_xml {
lib/API/Plesk.pm view on Meta::CPAN
api_version => '1.6.3.1',
debug => 0,
timeout => 30,
);
my $res = $api->customer->get();
if ($res->is_success) {
for ( @{$res->data} ) {
print "login: $_->{login}\n";
}
}
else {
print $res->error;
}
=head1 DESCRIPTION
At present the module provides interaction with Plesk 10.1 (API 1.6.3.1).
Distribution was completely rewritten and become more friendly for developers.
Naming of packages and methods become similar to the same operators and operations of Plesk XML API.
Partially implemented:
lib/API/Plesk.pm view on Meta::CPAN
=item xml_http_req( $xml )
Internal method. it implements real request sending to Plesk API.
Returns array ( $response_xml, $error ).
=back
=head1 SEE ALSO
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/PleskExpand.pm view on Meta::CPAN
use API::PleskExpand;
use API::Plesk::Response;
my $expand_client = API::PleskExpand->new(%params);
my $res = $expand_client->Func_Module->operation_type(%params);
if ($res->is_success) {
$res->get_data; # return arr ref of answer blocks
}
=head1 DESCRIPTION
At present the module provides interaction with Plesk Expand 2.2.4 (API 2.2.4.1). Complete support of operations with Accounts, partial support of work with domains. Support of addition of domains to user Accounts.
API::PleskExpand module gives the convenient interface for addition of new functions. Extensions represent modules in a folder Plesk with definitions of demanded functions. Each demanded operation is described by two functions: op and op_response_par...
For example, here the set of subs in the Accounts module is those.
create / create_response_parse
modify / modify_response_parse
delete / delete_response_parse
get / get_response_parse
=head1 EXPORT
Nothing.
lib/API/PleskExpand.pm view on Meta::CPAN
}
=item AUTOLOADed methods
All other methods are loaded by Autoload from corresponding modules.
Execute some operations (see API::PleskExpand::* modules documentation).
Example:
my $res = $expand_client->Func_Module->operation_type(%params);
# Func_Module -- module in API/PleskExpand folder
# operation_type -- sub which defined in Func_Module.
# params hash used as @_ for operation_type sub.
=back
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/PureStorage.pm view on Meta::CPAN
sub _api_get {
my $self = shift @_;
my $url = shift @_;
my $ret = $self->{client}->GET($url);
my $num = $ret->responseCode();
my $con = $ret->responseContent();
if ( $num == 500 ) {
die "API returned error 500 for '$url' - $con\n";
}
if ( $num != 200 ) {
die "API returned code $num for URL '$url'\n";
lib/API/PureStorage.pm view on Meta::CPAN
sub _api_post {
my $self = shift @_;
my $url = shift @_;
my $data = shift @_;
my $ret = $self->{client}->POST($url, to_json($data));
my $num = $ret->responseCode();
my $con = $ret->responseContent();
if ( $num == 500 ) {
die "API returned error 500 for '$url' - $con\n";
}
if ( $num != 200 ) {
die "API returned code $num for URL '$url'\n";
lib/API/PureStorage.pm view on Meta::CPAN
my $volume_info_ref = $pure->volume_info();
Returns an array or arrayref of general information about volumes include space
usage.
Each element of the array is a hash reference, representing a single volume.
=head3 Hash data reference:
* name - the name of this volume
lib/API/PureStorage.pm view on Meta::CPAN
Returns an array/arrayref of API versions supported by the storage array.
=head1 SEE ALSO
http://www.purestorage.com/
=head1 REQUESTS
=head1 BUGS AND SOURCE
view all matches for this distribution
view release on metacpan or search on metacpan
ReviewBoard.pm view on Meta::CPAN
my $link = $self->{_hostedurl}.'api/json/accounts/login/';
my $request = new HTTP::Request('POST',$link);
my $content = 'username='.$self->{_username}.'&password='.$self->{_password};
$request->content($content);
my $response = $self->{_useragent}->simple_request($request);
# extract cookie from response header
$self->{_cookie_jar}->extract_cookies($response);
bless $self,$class;
return $self;
ReviewBoard.pm view on Meta::CPAN
# get request to get review number based on change number
my $changenumlink = $self->{_hostedurl}.'/api/review-requests/?changenum='.$self->{_changenum};
my $request = new HTTP::Request('GET', $changenumlink);
$self->{_cookie_jar}->add_cookie_header($request);
my $response = $self->{_useragent}->simple_request($request);
my $xml = $response->as_string;
$xml=~ m/.*"id": (\d+),.*/;
my $reviewnum = $1;
my $reviewlink = $self->{_hostedurl}.'/r/'.$reviewnum;
ReviewBoard.pm view on Meta::CPAN
# get request to get review number based on change number
my $changenumlink = $self->{_hostedurl}.'/api/review-requests/?changenum='.$self->{_changenum};
my $request = new HTTP::Request('GET', $changenumlink);
$self->{_cookie_jar}->add_cookie_header($request);
my $response = $self->{_useragent}->simple_request($request);
my $xml = $response->as_string;
$xml =~ m/.*"description": "(.*)", "links".*/;
my $description = $1;
$description =~ s/(\\n)+/\n/g;
ReviewBoard.pm view on Meta::CPAN
$self->{_changenum} = $args{changenum};
my $changenumlink = $self->{_hostedurl}.'/api/review-requests/?changenum='.$self->{_changenum};
my $request = new HTTP::Request('GET', $changenumlink);
$self->{_cookie_jar}->add_cookie_header($request);
my $response = $self->{_useragent}->simple_request($request);
my $xml = $response->as_string;
$xml =~ m/.*"time_added": "(.*)", "summary".*/;
my $dateadded = $1;
return ($dateadded);
ReviewBoard.pm view on Meta::CPAN
$self->{_changenum} = $args{changenum};
my $changenumlink = $self->{_hostedurl}.'/api/review-requests/?changenum='.$self->{_changenum};
my $request = new HTTP::Request('GET', $changenumlink);
$self->{_cookie_jar}->add_cookie_header($request);
my $response = $self->{_useragent}->simple_request($request);
my $xml = $response->as_string;
$xml =~ /.*"last_updated": "(.*)", "description".*/;
my $lastupdated = $1;
ReviewBoard.pm view on Meta::CPAN
$self->{_changenum} = $args{changenum};
my $userlink = $self->{_hostedurl}.'/api/review-requests/?changenum='.$self->{_changenum};
my $request = new HTTP::Request('GET', $userlink);
$self->{_cookie_jar}->add_cookie_header($request);
my $response = $self->{_useragent}->simple_request($request);
my $xml = $response->as_string;
$xml =~ m/.*"target_people": (.*), "testing_done".*/;
my $name = $1;
my @arr;
my $count = @arr = $name =~ /"title": "(\w+)"/g;
ReviewBoard.pm view on Meta::CPAN
my $userlink = $self->{_hostedurl}.'/api/review-requests/?changenum='.$self->{_changenum};
my $request = new HTTP::Request('GET', $userlink);
$self->{_cookie_jar}->add_cookie_header($request);
my $response = $self->{_useragent}->simple_request($request);
my $xml = $response->as_string;
$xml =~ m/.*"submitter": (.*), "screenshots".*/;
my $name = $1;
my @arr;
my $count = @arr = $name =~ /"title": "(\w+)"/g;
ReviewBoard.pm view on Meta::CPAN
my $userlink = $self->{_hostedurl}.'/api/review-requests/?changenum='.$self->{_changenum};
my $request = new HTTP::Request('GET', $userlink);
$self->{_cookie_jar}->add_cookie_header($request);
my $response = $self->{_useragent}->simple_request($request);
my $xml = $response->as_string;
$xml =~ m/.*"summary": "(.*)", "public".*/;
my $summary = $1;
ReviewBoard.pm view on Meta::CPAN
$self->{_changenum} = $args{changenum};
my $userlink = $self->{_hostedurl}.'/api/review-requests/?changenum='.$self->{_changenum};
my $request = new HTTP::Request('GET', $userlink);
$self->{_cookie_jar}->add_cookie_header($request);
my $response = $self->{_useragent}->simple_request($request);
my $xml = $response->as_string;
$xml =~ m/.*"bugs_closed": (.*), "changenum".*/;
my $bugids = $1;
return ($bugids);
}
ReviewBoard.pm view on Meta::CPAN
$self->{_reviewnum} = $args{reviewnum};
my $userlink = $self->{_hostedurl}.'/api/review-requests/'.$self->{_reviewnum}.'/reviews/?counts-only=1';
my $request = new HTTP::Request('GET', $userlink);
$self->{_cookie_jar}->add_cookie_header($request);
my $response = $self->{_useragent}->simple_request($request);
my $xml = $response->as_string;
$xml =~ m/.*{"count": (\d+).*/ ;
my $count = $1;
return $count;
ReviewBoard.pm view on Meta::CPAN
$self->{_user} = $args{user};
my $userlink = $self->{_hostedurl}.'/api/review-requests/?from-user='.$self->{_user}.'&status=all&counts-only=1';
my $request = new HTTP::Request('GET', $userlink);
$self->{_cookie_jar}->add_cookie_header($request);
my $response = $self->{_useragent}->simple_request($request);
my $xml = $response->as_string;
$xml =~ m/.*{"count": (\d+).*/ ;
my $count = $1;
return ($count);
ReviewBoard.pm view on Meta::CPAN
$self->{_enddate} = $args{enddate};
my $userlink = $self->{_hostedurl}.'/api/review-requests/?from-user='.$self->{_user}.'&time-added-from='.$self->{_startdate}.'&time-added-to='.$self->{_enddate}.'&status=all&counts-only=1';
my $request = new HTTP::Request('GET', $userlink);
$self->{_cookie_jar}->add_cookie_header($request);
my $response = $self->{_useragent}->simple_request($request);
my $xml = $response->as_string;
$xml =~ m/.*{"count": (\d+).*/ ;
my $count = $1;
return $count;
ReviewBoard.pm view on Meta::CPAN
$self->{_status} = $args{status};
my $userlink = $self->{_hostedurl}.'/api/review-requests/?from-user='.$self->{_user}.'&status='.$self->{_status}.'&counts-only=1';
my $request = new HTTP::Request('GET', $userlink);
$self->{_cookie_jar}->add_cookie_header($request);
my $response = $self->{_useragent}->simple_request($request);
my $xml = $response->as_string;
$xml =~ m/.*{"count": (\d+).*/ ;
my $count = $1;
return $count;
ReviewBoard.pm view on Meta::CPAN
$self->{_user} = $args{user};
my $userlink = $self->{_hostedurl}.'/api/review-requests/?to-users='.$self->{_user}.'&counts-only=1';
my $request = new HTTP::Request('GET', $userlink);
$self->{_cookie_jar}->add_cookie_header($request);
my $response = $self->{_useragent}->simple_request($request);
my $xml = $response->as_string;
$xml =~ m/.*{"count": (\d+).*/ ;
my $count = $1;
return $count;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/Stripe.pm view on Meta::CPAN
# ABSTRACT: Stripe.com API Client
package API::Stripe;
use Data::Object::Class;
use Data::Object::Signatures;
use Data::Object::Library qw(
Str
);
lib/API/Stripe.pm view on Meta::CPAN
return $self;
}
method resource (@segments) {
# build new resource instance
my $instance = __PACKAGE__->new(
debug => $self->debug,
fatal => $self->fatal,
retries => $self->retries,
timeout => $self->timeout,
lib/API/Stripe.pm view on Meta::CPAN
identifier => $self->identifier,
username => $self->username,
version => $self->version,
);
# resource locator
my $url = $instance->url;
# modify resource locator if possible
$url->path(join '/', $self->url->path, @segments);
# return resource instance
return $instance;
}
1;
lib/API/Stripe.pm view on Meta::CPAN
$stripe->debug(1);
$stripe->fatal(1);
my $charge = $stripe->charges('ch_163Gh12CVMZwIkvc');
my $results = $charge->fetch;
# after some introspection
$charge->update( ... );
lib/API/Stripe.pm view on Meta::CPAN
=head2 debug
$stripe->debug;
$stripe->debug(1);
The debug attribute if true prints HTTP requests and responses to standard out.
=head2 fatal
$stripe->fatal;
$stripe->fatal(1);
The fatal attribute if true promotes 4xx and 5xx server response codes to
exceptions, a L<API::Client::Exception> object.
=head2 retries
$stripe->retries;
$stripe->retries(10);
The retries attribute determines how many times an HTTP request should be
retried if a 4xx or 5xx response is received. This attribute defaults to 0.
=head2 timeout
$stripe->timeout;
$stripe->timeout(5);
lib/API/Stripe.pm view on Meta::CPAN
=head1 METHODS
=head2 action
my $result = $stripe->action($verb, %args);
# e.g.
$stripe->action('head', %args); # HEAD request
$stripe->action('options', %args); # OPTIONS request
$stripe->action('patch', %args); # PATCH request
The action method issues a request to the API resource represented by the
object. The first parameter will be used as the HTTP request method. The
arguments, expected to be a list of key/value pairs, will be included in the
request if the key is either C<data> or C<query>.
=head2 create
my $results = $stripe->create(%args);
# or
$stripe->POST(%args);
The create method issues a C<POST> request to the API resource represented by
the object. The arguments, expected to be a list of key/value pairs, will be
included in the request if the key is either C<data> or C<query>.
=head2 delete
my $results = $stripe->delete(%args);
# or
$stripe->DELETE(%args);
The delete method issues a C<DELETE> request to the API resource represented by
the object. The arguments, expected to be a list of key/value pairs, will be
included in the request if the key is either C<data> or C<query>.
=head2 fetch
my $results = $stripe->fetch(%args);
# or
$stripe->GET(%args);
The fetch method issues a C<GET> request to the API resource represented by the
object. The arguments, expected to be a list of key/value pairs, will be
included in the request if the key is either C<data> or C<query>.
=head2 update
my $results = $stripe->update(%args);
# or
$stripe->PUT(%args);
The update method issues a C<PUT> request to the API resource represented by
the object. The arguments, expected to be a list of key/value pairs, will be
included in the request if the key is either C<data> or C<query>.
=head1 RESOURCES
=head2 account
$stripe->account;
The account method returns a new instance representative of the API
I<Account> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://stripe.com/docs/api#account>.
=head2 application_fees
$stripe->application_fees;
The application_fees method returns a new instance representative of the API
I<Application Fees> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://stripe.com/docs/api#application_fees>.
=head2 balance
$stripe->balance->history;
The balance method returns a new instance representative of the API
I<Balance> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://stripe.com/docs/api#balance>.
=head2 bitcoin_receivers
$stripe->bitcoin->receivers;
The bitcoin_receivers method returns a new instance representative of the API
I<Bitcoin Receivers> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://stripe.com/docs/api#bitcoin_receivers>.
=head2 cards
$stripe->cards;
The cards method returns a new instance representative of the API
I<Cards> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://stripe.com/docs/api#cards>.
=head2 charges
$stripe->charges;
The charges method returns a new instance representative of the API
I<Charges> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://stripe.com/docs/api#charges>.
=head2 coupons
$stripe->coupons;
The coupons method returns a new instance representative of the API
I<Coupons> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://stripe.com/docs/api#coupons>.
=head2 customers
$stripe->customers;
The customers method returns a new instance representative of the API
I<Customers> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://stripe.com/docs/api#customers>.
=head2 discounts
$stripe->discounts;
The discounts method returns a new instance representative of the API
I<Discounts> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://stripe.com/docs/api#discounts>.
=head2 disputes
$stripe->disputes;
The disputes method returns a new instance representative of the API
I<Disputes> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://stripe.com/docs/api#disputes>.
=head2 events
$stripe->events;
The events method returns a new instance representative of the API
I<Events> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://stripe.com/docs/api#events>.
=head2 fee_refunds
$stripe->application_fees('fee_6HiNDgLZ85q6KD')->refunds('fr_6HiNza7kmLzMFc');
The fee_refunds method returns a new instance representative of the API
I<Application Fee Refunds> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://stripe.com/docs/api#fee_refunds>.
=head2 file_uploads
$stripe->files;
The file_uploads method returns a new instance representative of the API
I<File Uploads> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://stripe.com/docs/api#file_uploads>.
=head2 invoiceitems
$stripe->invoiceitems;
The invoiceitems method returns a new instance representative of the API
I<Invoice Items> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://stripe.com/docs/api#invoiceitems>.
=head2 invoices
$stripe->invoices;
The invoices method returns a new instance representative of the API
I<Invoices> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://stripe.com/docs/api#invoices>.
=head2 plans
$stripe->plans;
The plans method returns a new instance representative of the API
I<Plans> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://stripe.com/docs/api#plans>.
=head2 recipients
$stripe->recipients;
The recipients method returns a new instance representative of the API
I<Recipients> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://stripe.com/docs/api#recipients>.
=head2 refunds
$stripe->refunds;
The refunds method returns a new instance representative of the API
I<Refunds> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://stripe.com/docs/api#refunds>.
=head2 subscriptions
$stripe->subscriptions;
The subscriptions method returns a new instance representative of the API
I<Subscriptions> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://stripe.com/docs/api#subscriptions>.
=head2 tokens
$stripe->tokens;
The tokens method returns a new instance representative of the API
I<Tokens> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://stripe.com/docs/api#tokens>.
=head2 transfer_reversals
$stripe->transfers('tr_164xRv2eZvKYlo2CZxJZWm1E')->reversals;
The transfer_reversals method returns a new instance representative of the API
I<Transfer Reversals> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://stripe.com/docs/api#transfer_reversals>.
=head2 transfers
$stripe->transfers;
The transfers method returns a new instance representative of the API
I<Transfers> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://stripe.com/docs/api#transfers>.
=head1 AUTHOR
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/Trello.pm view on Meta::CPAN
# ABSTRACT: Trello.com API Client
package API::Trello;
use Data::Object::Class;
use Data::Object::Signatures;
use Data::Object::Library qw(
Str
);
lib/API/Trello.pm view on Meta::CPAN
# default headers
$headers->header('Content-Type' => 'application/json');
}
method resource (@segments) {
# build new resource instance
my $instance = __PACKAGE__->new(
debug => $self->debug,
fatal => $self->fatal,
retries => $self->retries,
timeout => $self->timeout,
lib/API/Trello.pm view on Meta::CPAN
token => $self->token,
identifier => $self->identifier,
version => $self->version,
);
# resource locator
my $url = $instance->url;
# modify resource locator if possible
$url->path(join '/', $self->url->path, @segments);
# return resource instance
return $instance;
}
1;
lib/API/Trello.pm view on Meta::CPAN
$trello->debug(1);
$trello->fatal(1);
my $board = $trello->boards('4d5ea62fd76a');
my $results = $board->fetch;
# after some introspection
$board->update( ... );
lib/API/Trello.pm view on Meta::CPAN
=head2 debug
$trello->debug;
$trello->debug(1);
The debug attribute if true prints HTTP requests and responses to standard out.
=head2 fatal
$trello->fatal;
$trello->fatal(1);
The fatal attribute if true promotes 4xx and 5xx server response codes to
exceptions, a L<API::Client::Exception> object.
=head2 retries
$trello->retries;
$trello->retries(10);
The retries attribute determines how many times an HTTP request should be
retried if a 4xx or 5xx response is received. This attribute defaults to 0.
=head2 timeout
$trello->timeout;
$trello->timeout(5);
lib/API/Trello.pm view on Meta::CPAN
=head1 METHODS
=head2 action
my $result = $trello->action($verb, %args);
# e.g.
$trello->action('head', %args); # HEAD request
$trello->action('options', %args); # OPTIONS request
$trello->action('patch', %args); # PATCH request
The action method issues a request to the API resource represented by the
object. The first parameter will be used as the HTTP request method. The
arguments, expected to be a list of key/value pairs, will be included in the
request if the key is either C<data> or C<query>.
=head2 create
my $results = $trello->create(%args);
# or
$trello->POST(%args);
The create method issues a C<POST> request to the API resource represented by
the object. The arguments, expected to be a list of key/value pairs, will be
included in the request if the key is either C<data> or C<query>.
=head2 delete
my $results = $trello->delete(%args);
# or
$trello->DELETE(%args);
The delete method issues a C<DELETE> request to the API resource represented by
the object. The arguments, expected to be a list of key/value pairs, will be
included in the request if the key is either C<data> or C<query>.
=head2 fetch
my $results = $trello->fetch(%args);
# or
$trello->GET(%args);
The fetch method issues a C<GET> request to the API resource represented by the
object. The arguments, expected to be a list of key/value pairs, will be
included in the request if the key is either C<data> or C<query>.
=head2 update
my $results = $trello->update(%args);
# or
$trello->PUT(%args);
The update method issues a C<PUT> request to the API resource represented by
the object. The arguments, expected to be a list of key/value pairs, will be
included in the request if the key is either C<data> or C<query>.
=head1 RESOURCES
=head2 actions
$trello->actions;
The actions method returns a new instance representative of the API
I<actions> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://trello.com/docs/api/action/index.html>.
=head2 batch
$trello->batch;
The batch method returns a new instance representative of the API
I<batch> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://trello.com/docs/api/batch/index.html>.
=head2 boards
$trello->boards;
The boards method returns a new instance representative of the API
I<boards> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://trello.com/docs/api/board/index.html>.
=head2 cards
$trello->cards;
The cards method returns a new instance representative of the API
I<cards> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://trello.com/docs/api/card/index.html>.
=head2 checklists
$trello->checklists;
The checklists method returns a new instance representative of the API
I<checklists> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://trello.com/docs/api/checklist/index.html>.
=head2 labels
$trello->labels;
The labels method returns a new instance representative of the API
I<labels> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://trello.com/docs/api/label/index.html>.
=head2 lists
$trello->lists;
The lists method returns a new instance representative of the API
I<lists> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://trello.com/docs/api/list/index.html>.
=head2 members
$trello->members;
The members method returns a new instance representative of the API
I<members> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://trello.com/docs/api/member/index.html>.
=head2 notifications
$trello->notifications;
The notifications method returns a new instance representative of the API
I<notifications> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://trello.com/docs/api/notification/index.html>.
=head2 organizations
$trello->organizations;
The organizations method returns a new instance representative of the API
I<organizations> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://trello.com/docs/api/organization/index.html>.
=head2 search
$trello->search;
The search method returns a new instance representative of the API
I<search> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://trello.com/docs/api/search/index.html>.
=head2 sessions
$trello->sessions;
The sessions method returns a new instance representative of the API
I<sessions> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://trello.com/docs/api/session/index.html>.
=head2 tokens
$trello->tokens;
The tokens method returns a new instance representative of the API
I<tokens> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://trello.com/docs/api/token/index.html>.
=head2 types
$trello->types;
The types method returns a new instance representative of the API
I<types> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://trello.com/docs/api/type/index.html>.
=head2 webhooks
$trello->webhooks;
The webhooks method returns a new instance representative of the API
I<webhooks> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://trello.com/docs/api/webhook/index.html>.
=head1 AUTHOR
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/Twitter.pm view on Meta::CPAN
# ABSTRACT: Twitter.com API Client
package API::Twitter;
use Data::Object::Class;
use Data::Object::Signatures;
use Data::Object::Library qw(
Str
);
lib/API/Twitter.pm view on Meta::CPAN
);
has oauth_type => (
is => 'rw',
isa => Str,
default => 'protected resource',
required => 0,
);
# DEFAULTS
lib/API/Twitter.pm view on Meta::CPAN
# authorization header
$headers->header('Authorization' => $oauth->to_authorization_header);
}
method resource (@segments) {
# build new resource instance
my $instance = __PACKAGE__->new(
debug => $self->debug,
fatal => $self->fatal,
retries => $self->retries,
timeout => $self->timeout,
lib/API/Twitter.pm view on Meta::CPAN
access_token_secret => $self->access_token_secret,
consumer_key => $self->consumer_key,
consumer_secret => $self->consumer_secret,
);
# resource locator
my $url = $instance->url;
# modify resource locator if possible
$url->path(join '/', $self->url->path, @segments);
# return resource instance
return $instance;
}
1;
lib/API/Twitter.pm view on Meta::CPAN
$twitter->debug(1);
$twitter->fatal(1);
my $user = $twitter->users('lookup');
my $results = $user->fetch;
# after some introspection
$user->update( ... );
=head1 DESCRIPTION
This distribution provides an object-oriented thin-client library for
interacting with the Twitter (L<http://twitter.com>) API. For usage and
documentation information visit L<https://dev.twitter.com/rest/public>.
API::Twitter is derived from L<API::Client> and inherits all of it's
functionality. Please read the documentation for API::Client for more
usage information.
=head1 ATTRIBUTES
lib/API/Twitter.pm view on Meta::CPAN
=head2 debug
$twitter->debug;
$twitter->debug(1);
The debug attribute if true prints HTTP requests and responses to standard out.
=head2 fatal
$twitter->fatal;
$twitter->fatal(1);
The fatal attribute if true promotes 4xx and 5xx server response codes to
exceptions, a L<API::Client::Exception> object.
=head2 retries
$twitter->retries;
$twitter->retries(10);
The retries attribute determines how many times an HTTP request should be
retried if a 4xx or 5xx response is received. This attribute defaults to 1.
=head2 timeout
$twitter->timeout;
$twitter->timeout(5);
lib/API/Twitter.pm view on Meta::CPAN
=head1 METHODS
=head2 action
my $result = $twitter->action($verb, %args);
# e.g.
$twitter->action('head', %args); # HEAD request
$twitter->action('options', %args); # OPTIONS request
$twitter->action('patch', %args); # PATCH request
The action method issues a request to the API resource represented by the
object. The first parameter will be used as the HTTP request method. The
arguments, expected to be a list of key/value pairs, will be included in the
request if the key is either C<data> or C<query>.
=head2 create
my $results = $twitter->create(%args);
# or
$twitter->POST(%args);
The create method issues a C<POST> request to the API resource represented by
the object. The arguments, expected to be a list of key/value pairs, will be
included in the request if the key is either C<data> or C<query>.
=head2 delete
my $results = $twitter->delete(%args);
# or
$twitter->DELETE(%args);
The delete method issues a C<DELETE> request to the API resource represented by
the object. The arguments, expected to be a list of key/value pairs, will be
included in the request if the key is either C<data> or C<query>.
=head2 fetch
my $results = $twitter->fetch(%args);
# or
$twitter->GET(%args);
The fetch method issues a C<GET> request to the API resource represented by the
object. The arguments, expected to be a list of key/value pairs, will be
included in the request if the key is either C<data> or C<query>.
=head2 update
my $results = $twitter->update(%args);
# or
$twitter->PUT(%args);
The update method issues a C<PUT> request to the API resource represented by
the object. The arguments, expected to be a list of key/value pairs, will be
included in the request if the key is either C<data> or C<query>.
=head1 RESOURCES
=head2 account
$twitter->account;
The account method returns a new instance representative of the API
resource requested. This method accepts a list of path segments which will be
used in the HTTP request. The following documentation can be used to find more
information. L<https://dev.twitter.com/rest/public#account>.
=head2 application
$twitter->application;
The application method returns a new instance representative of the API
resource requested. This method accepts a list of path segments which will be
used in the HTTP request. The following documentation can be used to find more
information. L<https://dev.twitter.com/rest/public#application>.
=head2 blocks
$twitter->blocks;
The blocks method returns a new instance representative of the API
resource requested. This method accepts a list of path segments which will be
used in the HTTP request. The following documentation can be used to find more
information. L<https://dev.twitter.com/rest/public#blocks>.
=head2 direct_messages
$twitter->direct_messages;
The direct_messages method returns a new instance representative of the API
resource requested. This method accepts a list of path segments which will be
used in the HTTP request. The following documentation can be used to find more
information. L<https://dev.twitter.com/rest/public#direct_messages>.
=head2 favorites
$twitter->favorites;
The favorites method returns a new instance representative of the API
resource requested. This method accepts a list of path segments which will be
used in the HTTP request. The following documentation can be used to find more
information. L<https://dev.twitter.com/rest/public#favorites>.
=head2 followers
$twitter->followers;
The followers method returns a new instance representative of the API
resource requested. This method accepts a list of path segments which will be
used in the HTTP request. The following documentation can be used to find more
information. L<https://dev.twitter.com/rest/public#followers>.
=head2 friends
$twitter->friends;
The friends method returns a new instance representative of the API
resource requested. This method accepts a list of path segments which will be
used in the HTTP request. The following documentation can be used to find more
information. L<https://dev.twitter.com/rest/public#friends>.
=head2 friendships
$twitter->friendships;
The friendships method returns a new instance representative of the API
resource requested. This method accepts a list of path segments which will be
used in the HTTP request. The following documentation can be used to find more
information. L<https://dev.twitter.com/rest/public#friendships>.
=head2 geo
$twitter->geo;
The geo method returns a new instance representative of the API
resource requested. This method accepts a list of path segments which will be
used in the HTTP request. The following documentation can be used to find more
information. L<https://dev.twitter.com/rest/public#geo>.
=head2 help
$twitter->help;
The help method returns a new instance representative of the API
resource requested. This method accepts a list of path segments which will be
used in the HTTP request. The following documentation can be used to find more
information. L<https://dev.twitter.com/rest/public#help>.
=head2 lists
$twitter->lists;
The lists method returns a new instance representative of the API
resource requested. This method accepts a list of path segments which will be
used in the HTTP request. The following documentation can be used to find more
information. L<https://dev.twitter.com/rest/public#lists>.
=head2 media
$twitter->media;
The media method returns a new instance representative of the API
resource requested. This method accepts a list of path segments which will be
used in the HTTP request. The following documentation can be used to find more
information. L<https://dev.twitter.com/rest/public#media>.
=head2 mutes
$twitter->mutes;
The mutes method returns a new instance representative of the API
resource requested. This method accepts a list of path segments which will be
used in the HTTP request. The following documentation can be used to find more
information. L<https://dev.twitter.com/rest/public#mutes>.
=head2 saved_searches
$twitter->saved_searches;
The saved_searches method returns a new instance representative of the API
resource requested. This method accepts a list of path segments which will be
used in the HTTP request. The following documentation can be used to find more
information. L<https://dev.twitter.com/rest/public#saved_searches>.
=head2 search
$twitter->search;
The search method returns a new instance representative of the API
resource requested. This method accepts a list of path segments which will be
used in the HTTP request. The following documentation can be used to find more
information. L<https://dev.twitter.com/rest/public#search>.
=head2 statuses
$twitter->statuses;
The statuses method returns a new instance representative of the API
resource requested. This method accepts a list of path segments which will be
used in the HTTP request. The following documentation can be used to find more
information. L<https://dev.twitter.com/rest/public#statuses>.
=head2 trends
$twitter->trends;
The trends method returns a new instance representative of the API
resource requested. This method accepts a list of path segments which will be
used in the HTTP request. The following documentation can be used to find more
information. L<https://dev.twitter.com/rest/public#trends>.
=head2 users
$twitter->users;
The users method returns a new instance representative of the API
resource requested. This method accepts a list of path segments which will be
used in the HTTP request. The following documentation can be used to find more
information. L<https://dev.twitter.com/rest/public#users>.
=head1 AUTHOR
Al Newkirk <anewkirk@ana.io>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/Vultr.pm view on Meta::CPAN
use API::Vultr;
use Data::Dumper qw(Dumper);
my $vultr_api = API::Vultr->new(api_key => $ENV{VULTR_API_KEY});
my $create_response = $vultr_api->create_instance(
region => 'ewr',
plan => 'vc2-6c-16gb',
label => 'My Instance',
os_id => 215,
user_data => 'QmFzZTY4EVsw32WfsGGHsjKJI',
backups => 'enabled',
hostname => 'hostname'
);
if ($create_response->is_success) {
print Dumper($create_response->decoded_content);
}
else {
die $create_response->status_line;
}
=head1 API
=head2 ua
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/Wunderlist.pm view on Meta::CPAN
# ABSTRACT: Wunderlist.com API Client
package API::Wunderlist;
use Data::Object::Class;
use Data::Object::Signatures;
use Data::Object::Library qw(
Str
);
lib/API/Wunderlist.pm view on Meta::CPAN
$headers->header('X-Access-Token' => $self->access_token);
$headers->header('Content-Type' => 'application/json');
}
method resource (@segments) {
# build new resource instance
my $instance = __PACKAGE__->new(
debug => $self->debug,
fatal => $self->fatal,
retries => $self->retries,
timeout => $self->timeout,
lib/API/Wunderlist.pm view on Meta::CPAN
client_id => $self->client_id,
access_token => $self->access_token,
version => $self->version,
);
# resource locator
my $url = $instance->url;
# modify resource locator if possible
$url->path(join '/', $self->url->path, @segments);
# return resource instance
return $instance;
}
1;
lib/API/Wunderlist.pm view on Meta::CPAN
$wunderlist->debug(1);
$wunderlist->fatal(1);
my $list = $wunderlist->lists('12345');
my $results = $list->fetch;
# after some introspection
$list->update( ... );
lib/API/Wunderlist.pm view on Meta::CPAN
=head2 debug
$wunderlist->debug;
$wunderlist->debug(1);
The debug attribute if true prints HTTP requests and responses to standard out.
=head2 fatal
$wunderlist->fatal;
$wunderlist->fatal(1);
The fatal attribute if true promotes 4xx and 5xx server response codes to
exceptions, a L<API::Client::Exception> object.
=head2 retries
$wunderlist->retries;
$wunderlist->retries(10);
The retries attribute determines how many times an HTTP request should be
retried if a 4xx or 5xx response is received. This attribute defaults to 0.
=head2 timeout
$wunderlist->timeout;
$wunderlist->timeout(5);
lib/API/Wunderlist.pm view on Meta::CPAN
=head1 METHODS
=head2 action
my $result = $wunderlist->action($verb, %args);
# e.g.
$wunderlist->action('head', %args); # HEAD request
$wunderlist->action('options', %args); # OPTIONS request
$wunderlist->action('patch', %args); # PATCH request
The action method issues a request to the API resource represented by the
object. The first parameter will be used as the HTTP request method. The
arguments, expected to be a list of key/value pairs, will be included in the
request if the key is either C<data> or C<query>.
=head2 create
my $results = $wunderlist->create(%args);
# or
$wunderlist->POST(%args);
The create method issues a C<POST> request to the API resource represented by
the object. The arguments, expected to be a list of key/value pairs, will be
included in the request if the key is either C<data> or C<query>.
=head2 delete
my $results = $wunderlist->delete(%args);
# or
$wunderlist->DELETE(%args);
The delete method issues a C<DELETE> request to the API resource represented by
the object. The arguments, expected to be a list of key/value pairs, will be
included in the request if the key is either C<data> or C<query>.
=head2 fetch
my $results = $wunderlist->fetch(%args);
# or
$wunderlist->GET(%args);
The fetch method issues a C<GET> request to the API resource represented by the
object. The arguments, expected to be a list of key/value pairs, will be
included in the request if the key is either C<data> or C<query>.
=head2 update
my $results = $wunderlist->update(%args);
# or
$wunderlist->PUT(%args);
The update method issues a C<PUT> request to the API resource represented by
the object. The arguments, expected to be a list of key/value pairs, will be
included in the request if the key is either C<data> or C<query>.
=head1 RESOURCES
=head2 avatars
$wunderlist->avatars;
The avatars method returns a new instance representative of the API
I<Avatar> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://developer.wunderlist.com/documentation/endpoints/avatar>.
=head2 file_previews
$wunderlist->previews;
The file_previews method returns a new instance representative of the API
I<Preview> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://developer.wunderlist.com/documentation/endpoints/file_preview>.
=head2 files
$wunderlist->files;
The files method returns a new instance representative of the API
I<File> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://developer.wunderlist.com/documentation/endpoints/file>.
=head2 folders
$wunderlist->folders;
The folders method returns a new instance representative of the API
I<Folder> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://developer.wunderlist.com/documentation/endpoints/folder>.
=head2 lists
$wunderlist->lists;
The lists method returns a new instance representative of the API
I<List> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://developer.wunderlist.com/documentation/endpoints/list>.
=head2 memberships
$wunderlist->memberships;
The memberships method returns a new instance representative of the API
I<Membership> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://developer.wunderlist.com/documentation/endpoints/membership>.
=head2 notes
$wunderlist->notes;
The notes method returns a new instance representative of the API
I<Note> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://developer.wunderlist.com/documentation/endpoints/note>.
=head2 positions
$wunderlist->list_positions;
The positions method returns a new instance representative of the API
I<Positions> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://developer.wunderlist.com/documentation/endpoints/positions>.
=head2 reminders
$wunderlist->reminders;
The reminders method returns a new instance representative of the API
I<Reminder> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://developer.wunderlist.com/documentation/endpoints/reminder>.
=head2 subtasks
$wunderlist->subtasks;
The subtasks method returns a new instance representative of the API
I<Subtask> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://developer.wunderlist.com/documentation/endpoints/subtask>.
=head2 task_comments
$wunderlist->task_comments;
The task_comments method returns a new instance representative of the API
I<Task Comment> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://developer.wunderlist.com/documentation/endpoints/task_comment>.
=head2 tasks
$wunderlist->tasks;
The tasks method returns a new instance representative of the API
I<Task> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://developer.wunderlist.com/documentation/endpoints/task>.
=head2 uploads
$wunderlist->uploads;
The uploads method returns a new instance representative of the API
I<Upload> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://developer.wunderlist.com/documentation/endpoints/upload>.
=head2 users
$wunderlist->users;
The users method returns a new instance representative of the API
I<User> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://developer.wunderlist.com/documentation/endpoints/user>.
=head2 webhooks
$wunderlist->webhooks;
The webhooks method returns a new instance representative of the API
I<Webhooks> resource requested. This method accepts a list of path
segments which will be used in the HTTP request. The following documentation
can be used to find more information. L<https://developer.wunderlist.com/documentation/endpoints/webhooks>.
=head1 AUTHOR
view all matches for this distribution
view release on metacpan or search on metacpan
lib/APISchema.pm view on Meta::CPAN
=head1 SYNOPSIS
# bmi.def
resource figure => {
type => 'object',
description => 'Figure, which includes weight and height',
properties => {
weight => {
type => 'number',
lib/APISchema.pm view on Meta::CPAN
},
},
required => ['weight', 'height'],
};
resource bmi => {
type => 'object',
description => 'Body mass index',
properties => {
value => {
type => 'number',
lib/APISchema.pm view on Meta::CPAN
destination => {
controller => 'BMI',
action => 'calculate',
},
request => 'figure',
response => 'bmi',
};
# main.pl
use APISchema::DSL;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/APNS/Agent.pm view on Meta::CPAN
private_key
sandbox
debug_port
/],
ro_lazy => {
on_error_response => sub {
sub {
my $self = shift;
my %d = %{$_[0]};
warnf "identifier:%s\tstate:%s\ttoken:%s", $d{identifier}, $d{state}, $d{token} || '';
}
lib/APNS/Agent.pm view on Meta::CPAN
}
sub _do_monitor {
my ($self, $req) = @_;
my $result = {
sent => $self->_sent,
queued => scalar( @{ $self->_queue } ),
};
my $body = encode_json($result);
return [200, [
'Content-Type' => 'application/json; charset=utf-8',
'Content-Length' => length($body),
], [$body]];
lib/APNS/Agent.pm view on Meta::CPAN
if (@{$self->_queue}) {
$self->_sending;
}
},
on_error_response => sub {
my ($identifier, $state) = @_;
my $data = $self->_sent_cache->get($identifier) || {};
$self->on_error_response->($self, {
identifier => $identifier,
state => $state,
token => $data->{token},
payload => $data->{payload},
});
lib/APNS/Agent.pm view on Meta::CPAN
=head1 DESCRIPTION
APNS::Agent is agent server for APNS. It is also backend class of L<apns-agent>.
This module provides consistent connection to APNS and cares reconnection. It utilizes
L<AnyEvent::APNS> internally.
B<THE SOFTWARE IS ALPHA QUALITY. API MAY CHANGE WITHOUT NOTICE.>
=head1 API PARAMETERS
view all matches for this distribution
view release on metacpan or search on metacpan
lib/APP/REST/ParallelMyUA.pm view on Meta::CPAN
make a a connection
=cut
sub on_connect {
my ( $self, $request, $response, $entry ) = @_;
#print time,"Connecting to ", $request->url, "\n";
print STDERR ".";
$entry->{tick}->{start} = time;
}
=head2 on_failure
on_failure gets called whenever a connection fails right away
(either we timed out, or failed to connect to this address before,
or it's a duplicate). Please note that non-connection based
errors, for example requests for non-existant pages, will NOT call
on_failure since the response from the server will be a well
formed HTTP response!
=cut
sub on_failure {
my ( $self, $request, $response, $entry ) = @_;
print "Failed to connect to ", $request->url, "\n\t", $response->code, ", ",
$response->message, "\n"
if $response;
}
=head2 on_return
on_return gets called whenever a connection (or its callback)
returns EOF (or any other terminating status code available for
callback functions). Please note that on_return gets called for
any successfully terminated HTTP connection! This does not imply
that the response sent from the server is a success!
=cut
sub on_return {
my ( $self, $request, $response, $entry ) = @_;
print ".";
#print time,"Response got from ", $request->url, "\n";
$entry->{tick}->{end} = time;
if ( $response->is_success ) {
#print "\n\nWoa! Request to ",$request->url," returned code ", $response->code,
# ": ", $response->message, "\n";
#print $response->content;
} else {
#print "\n\nBummer! Request to ",$request->url," returned code ", $response->code,
# ": ", $response->message, "\n";
#print $response->error_as_HTML;
}
return;
}
1;
lib/APP/REST/ParallelMyUA.pm view on Meta::CPAN
This license does not grant you the right to use any trademark, service
mark, tradename, or logo of the Copyright Holder.
This license includes the non-exclusive, worldwide, free-of-charge
patent license to make, have made, use, offer to sell, sell, import and
otherwise transfer the Package with respect to any patent claims
licensable by the Copyright Holder that are necessarily infringed by the
Package. If you institute patent litigation (including a cross-claim or
counterclaim) against any party alleging that the Package constitutes
direct or contributory patent infringement, then this Artistic License
to you shall terminate on the date that such litigation is filed.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# Whether or not inc::Module::Install is actually loaded, the
# $INC{inc/Module/Install.pm} is what will still get set as long as
# the caller loaded module this in the documented manner.
# If not set, the caller may NOT have loaded the bundled version, and thus
# they may not have a MI version that works with the Makefile.PL. This would
# result in false errors or unexpected behaviour. And we don't want that.
my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm';
unless ( $INC{$file} ) { die <<"END_DIE" }
Please invoke ${\__PACKAGE__} with:
inc/Module/Install.pm view on Meta::CPAN
eval "use Win32::UTCFileTime" if $^O eq 'MSWin32' && $] >= 5.006;
# If the script that is loading Module::Install is from the future,
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
inc/Module/Install.pm view on Meta::CPAN
sub new {
my ($class, %args) = @_;
delete $INC{'FindBin.pm'};
{
# to suppress the redefine warning
local $SIG{__WARN__} = sub {};
require FindBin;
}
# ignore the prefix on extension modules built from top level.
inc/Module/Install.pm view on Meta::CPAN
$file = "$self->{path}/$subpath.pm";
my $pkg = "$self->{name}::$subpath";
$pkg =~ s!/!::!g;
# If we have a mixed-case package name, assume case has been preserved
# correctly. Otherwise, root through the file to locate the case-preserved
# version of the package name.
if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) {
my $content = Module::Install::_read($subpath . '.pm');
my $in_pod = 0;
foreach ( split //, $content ) {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/MyBuilder.pm view on Meta::CPAN
sub _auto_mm {
my $self = shift;
my $mm = $self->meta_merge;
my @meta = qw( homepage bugtracker MailingList repository );
for my $meta ( @meta ) {
next if exists $mm->{resources}{$meta};
my $auto = "_auto_$meta";
next unless $self->can( $auto );
my $av = $self->$auto();
$mm->{resources}{$meta} = $av if defined $av;
}
$self->meta_merge( $mm );
}
sub _auto_repository {
view all matches for this distribution
view release on metacpan or search on metacpan
$ConfigPath = "/etc/arcx";
$DefaultPort = 4242;
$DefaultHost = "arcdsrv";
$DefaultPIDFile = "/var/run/arcxd.pid";
$Copyright = "ARCv2 $VERSION (C) 2003-5 Patrick Boettcher and others. All right reserved.";
$Contact = "Patrick Boettcher <patrick.boettcher\@desy.de>, Wolfgang Friebel <wolfgang.friebel\@desy.de>";
my @syslog_arr = ('emerg','alert','crit','err','warning','notice','info','debug');
# package member vars
## Logs messages to 'logdestination' if 'loglevel' is is set appropriatly.
## loglevel behaviour has changed in the 1.0 release of ARCv2, the "Arc"-class can export
## LOG_AUTH (authentication information), LOG_USER (connection information), LOG_ERR (errors),
## LOG_CMD (ARCv2 addition internal command information), LOG_SIDE (verbose client/server-specific
## information), LOG_DEBUG (verbose debug information). It possible to combine the
## levels with or (resp. +) to allow a message to appear when not all loglevels are
## requested by the user.
## Commonly used for logging errors from application level.
##in> $facility, ... (message)
##out> always false
##eg> return $arc->Log(LOG_ERR,"Message");
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ARGV/Abs.pm view on Meta::CPAN
use File::Spec;
sub import
{
# Base directory for resolving paths
my $base = $_[1];
unless (defined $base) {
require Cwd;
$base = Cwd::getcwd();
}
lib/ARGV/Abs.pm view on Meta::CPAN
=head1 DESCRIPTION
This module transform all elements of C<@ARGV> into absolute pathnames.
Relative paths are resolved by default relative to the current directory.
To use another base directory, pass it as the argument for import.
=head1 SEE ALSO
Some other modules that add magic to C<@ARGV>: L<ARGV::URL>, L<ARGV::readonly>, L<Encode::Argv>.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ARGV/ENV.pm view on Meta::CPAN
=head1 DESCRIPTION
This module searches the first non-empty environment variable with one of the
names given at import time, parses it like the Unix shell (using
L<Text::ParseWords>::shellwords) and insert the result at the beginning of
C<@ARGV>.
This module is helpful to implement command-line scripts that take some
global config as an environnement variable containing command-line flags.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ARGV/JSON.pm view on Meta::CPAN
perl -MARGV::JSON -anal -E 'say $_->{foo}->{bar}' a.json b.json
=head1 DESCRIPTION
ARGV::JSON parses each input from C<< @ARGV >> and enables to access
the JSON data structures via C<< <> >>.
Each C<< readline >> call to C<< <> >> (or C<< <ARGV> >>) returns a
hashref or arrayref or something that the input serializes in the
JSON format.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ARGV/OrDATA.pm view on Meta::CPAN
while (<>) { # This reads from My/Module.pm's DATA section.
print;
}
To restore the old behaviour, you can call the C<unimport> method.
use ARGV::OrDATA;
my $from_data = <>;
lib/ARGV/OrDATA.pm view on Meta::CPAN
@ARGV = 'file2.txt'; # Works.
my $from_file2 = <>;
Calling C<import> after C<unimport> would restore the DATA handle, but
B<wouldn't rewind it>, i.e. it would continue from where you stopped
(see t/04-unimport.t).
=head2 Why?
lib/ARGV/OrDATA.pm view on Meta::CPAN
This license does not grant you the right to use any trademark, service
mark, tradename, or logo of the Copyright Holder.
This license includes the non-exclusive, worldwide, free-of-charge
patent license to make, have made, use, offer to sell, sell, import and
otherwise transfer the Package with respect to any patent claims
licensable by the Copyright Holder that are necessarily infringed by the
Package. If you institute patent litigation (including a cross-claim or
counterclaim) against any party alleging that the Package constitutes
direct or contributory patent infringement, then this Artistic License
to you shall terminate on the date that such litigation is filed.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ARGV/Struct.pm view on Meta::CPAN
1;
#################### main pod documentation begin ###################
=head1 NAME
ARGV::Struct - Parse complex data structures passed in ARGV
=head1 SYNOPSIS
use ARGV::Struct;
my $struct = ARGV::Struct->new->parse;
lib/ARGV/Struct.pm view on Meta::CPAN
Have you ever felt that you need something different than Getopt?
Are you tired of shoehorning Getopt style arguments into your commandline scripts?
Are you trying to express complex datastructures via command line?
then ARGV::Struct is for you!
It's designed so the users of your command line utilities won't hate you when things
get complex.
lib/ARGV/Struct.pm view on Meta::CPAN
command --key key1 --value value1 --key key1 --value value 2
=head1 THE DESIGN
The design of this module is aimed at "playing well with the shell". The main purpose is
to let the user transmit complex data structures, while staying compact enough for command line
use.
=head2 Key/Value sets (objects)
On the command line, the user can transmit sets of key/value pairs within curly brackets
command { K_V_PAIR1 K_V_PAIR2 }
The shell is expected to do some work for us, so key/value pairs are separated by spaces
Each key/value pair is expressed as
Key: Value
The colon between Keys and values is optional, so
lib/ARGV/Struct.pm view on Meta::CPAN
=head1
=head1 TODO
Try to combine with Getopt/MooseX::Getopt, so some parameters could be an ARGV::Struct. The
rest would be parsed Getopt style.
=head1 CONTRIBUTE
The source code and issues are on https://github.com/pplu/ARGV-Struct
lib/ARGV/Struct.pm view on Meta::CPAN
jlmartinez@capside.com
http://www.pplusdomain.net
=head1 COPYRIGHT
Copyright (c) 2015 by Jose Luis Martinez Torres
This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the
view all matches for this distribution
view release on metacpan or search on metacpan
sure that you have the freedom to give away or sell copies of free
software, that you receive source code or can get it if you want it,
that you can change the software or use pieces of it in new free
programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of a such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
contains a notice placed by the copyright holder saying it may be
distributed under the terms of this General Public License. The
"Program", below, refers to any such program or work, and a "work based
on the Program" means either the Program or any work containing the
Program or a portion of it, either verbatim or with modifications. Each
licensee is addressed as "you".
1. You may copy and distribute verbatim copies of the Program's source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and
disclaimer of warranty; keep intact all the notices that refer to this
3. You may copy and distribute the Program (or a portion or derivative of
it, under Paragraph 2) in object code or executable form under the terms of
Paragraphs 1 and 2 above provided that you also do one of the following:
a) accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of
Paragraphs 1 and 2 above; or,
b) accompany it with a written offer, valid for at least three
years, to give any third party free (except for a nominal charge
for the cost of distribution) a complete machine-readable copy of the
corresponding source code, to be distributed under the terms of
Paragraphs 1 and 2 above; or,
c) accompany it with the information you received as to where the
corresponding source code may be obtained. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form alone.)
Source code for a work means the preferred form of the work for making
modifications to it. For an executable file, complete source code means
libraries that accompany the operating system on which the executable
file runs, or for standard header files or definitions files that
accompany that operating system.
4. You may not copy, modify, sublicense, distribute or transfer the
Program except as expressly provided under this General Public License.
Any attempt otherwise to copy, modify, sublicense, distribute or transfer
the Program is void, and will automatically terminate your rights to use
the Program under this License. However, parties who have received
copies, or rights to use copies, from you under this General Public
License will not have their licenses terminated so long as such parties
and all its terms and conditions.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the original
licensor to copy, distribute or modify the Program subject to these
terms and conditions. You may not impose any further restrictions on the
recipients' exercise of the rights granted herein.
7. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of the license which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
8. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
program `Gnomovision' (a program to direct compilers to make passes
at assemblers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
That's all there is to it!
--- The Artistic License 1.0 ---
there may be fees involved in handling the item. It also means that
recipients of the item may redistribute it under the same conditions they
received it.
1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated disclaimers.
2. You may apply bug fixes, portability fixes and other modifications derived
from the Public Domain or from the Copyright Holder. A Package modified in such
a way shall still be considered the Standard Version.
get the Standard Version.
b) accompany the distribution with the machine-readable source of the Package
with your modifications.
c) accompany any non-standard executables with their corresponding Standard
Version executables, giving the non-standard executables non-standard
names, and clearly documenting the differences in manual pages (or
equivalent), together with instructions on where to get the Standard
Version.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ARGV/readonly.pm view on Meta::CPAN
sub import{
# Tom Christiansen in Message-ID: <24692.1217339882@chthon>
# reccomends essentially the following:
for (@ARGV){
s/^(\s+)/.\/$1/; # leading whitespace preserved
s/^/< /; # force open for input
$_.=qq/\0/; # trailing whitespace preserved & pipes forbidden
};
};
1;
view all matches for this distribution
view release on metacpan or search on metacpan
examples/generate_fid_hash.pl view on Meta::CPAN
# [ 'ApplicationLicense' , 122, 'Optional', 'AR_DATA_TYPE_CHAR', 0 ],
# [ 'ApplicationLicenseType' , 115, 'Optional', 'AR_DATA_TYPE_CHAR', 254 ],
# [ 'AssignedTo' , 4, 'Optional', 'AR_DATA_TYPE_CHAR', 254 ],
# [ 'ComputedGrpList' , 119, 'Optional', 'AR_DATA_TYPE_CHAR', 255 ],
# [ 'DefaultNotifyMechanism' , 108, 'Optional', 'AR_DATA_TYPE_ENUM', undef ],
# [ 'EmailAddress' , 103, 'Optional', 'AR_DATA_TYPE_CHAR', 255 ],
# [ 'FlashboardsLicenseType' , 111, 'Optional', 'AR_DATA_TYPE_ENUM', undef ],
# [ 'FromConfig' , 250000003, 'Optional', 'AR_DATA_TYPE_CHAR', 3 ],
# [ 'GroupList' , 104, 'Optional', 'AR_DATA_TYPE_CHAR', 255 ],
# [ 'GrouplistIT' , 536870913, 'Optional', 'AR_DATA_TYPE_CHAR', 200 ],
# [ 'InstanceID' , 490000000, 'Optional', 'AR_DATA_TYPE_CHAR', 38 ],
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ARSObject.pm view on Meta::CPAN
,-dbi=>undef # DBI object, by dbiconnect()
,-dbiconnect =>undef #
,-cgi=>undef # CGI object, by cgi()
,-smtp=>undef
,-smtphost=>undef
#,-fpl=>[] # CGI Form Presenter fields list
#,-fphc=>{} # CGI fields cache
#,-fphd=>{} # DB fields cache
#,-fpbv=>[] # buffer values
#,-fpbn=>'' # buffer name == record common name
};
lib/ARSObject.pm view on Meta::CPAN
eval('use Safe; 1')
&& Safe->new()->reval($d)
}
sub dscmp { # Compare data structures
my($s, $ds1, $ds2) =@_;
return(1) if (defined($ds1) && !defined($ds2)) ||(defined($ds2) && !defined($ds1));
return(0) if !defined($ds1) && !defined($ds2);
return(1) if (ref($ds1) ||'') ne (ref($ds2) ||'');
return($ds1 cmp $ds2) if !ref($ds1);
lib/ARSObject.pm view on Meta::CPAN
$s->{-dbi} && eval{$s->{-dbi}->disconnect()};
$s->{-dbi} =undef;
}
sub arsmeta { # Load/refresh ARS metadata
my $s =shift; # -srv, -usr, -pswd, -lang
$s->set(@_);
local $s->{-cmd} =($s->{-cmd} ? $s->{-cmd} .': ' : '')
.($s->{-schgen} ? "dumper('" .$s->vfname('meta') ."')" : 'arsmeta()');
if (ref($s->{-schgen})
lib/ARSObject.pm view on Meta::CPAN
}
}
sub arsmetamin { # Minimal ARS metadata ('-meta-min' varfile)
my $s =shift; # refresh after 'arsmeta'/'connect'
$s->set(@_); # load instead of 'arsmeta'/'connect'
local $s->{-cmd} =($s->{-cmd} ? $s->{-cmd} .': ' : '')
.($s->{-schgen} ? "dumper('" .$s->vfname('meta-min') ."')" : 'arsmetamin()');
if (ref($s->{-schgen})
|| !$s->{-schgen}
lib/ARSObject.pm view on Meta::CPAN
$s;
}
sub arsmetasql { # SQL ARS metadata ('-meta-sql' varfile)
my $s =shift; # refresh after 'arsmeta'/'connect'
$s->set(@_); # !!! 'enum' texts
local $s->{-cmd} =($s->{-cmd} ? $s->{-cmd} .': ' : '')
.($s->{-schgen} ? "dumper('" .$s->vfname('meta-sql') ."')" : 'arsmetasql()');
if (ref($s->{-schgen})
|| !$s->{-schgen}
lib/ARSObject.pm view on Meta::CPAN
? 'return(false);'
: '')
.'}}'};
($s->{-cgi}->param("${n}__O_")
? "<div><script for=\"$n\" event=\"onkeypress\">" .&$fs(0) ."</script>\n"
: '')
.$s->{-cgi}->textfield((map {defined($_) && defined($a{$_})
? ($_ => $a{$_})
: $a{-textfield} && $a{-textfield}->{$_} && !$s->{-cgi}->param("${n}__O_")
? ($_ => $a{-textfield}->{$_})
lib/ARSObject.pm view on Meta::CPAN
."<input type=\"hidden\" name=\"${n}__P_\" value=\"" .(defined($v) ? $s->{-cgi}->escapeHTML($v) : '') ."\"$ac$as />\n"
."<br />\n"
."<select name=\"${n}__L_\" title=\"select value\" size=\"10\""
."$ac$as"
." ondblclick=\"{${n}__S_.focus(); ${n}__S_.click(); return(true)}\""
." onkeypress=\"" .($s->{-cgi}->user_agent('MSIE') ? &$fs(1) : &$fs(2))
."\">\n"
.join('',map {'<option'
.((defined($v) ? $v : '') eq (defined($_) ? $_ : '') ? ' selected' : '')
.' value="' .$s->{-cgi}->escapeHTML(defined($_) ? $_ : '') .'">'
.$s->{-cgi}->escapeHTML(
lib/ARSObject.pm view on Meta::CPAN
}
1
}
sub cfpinit { # Field Player: init data structures
my ($s) =@_; # (self) -> self
$s->{-fphc} ={};
$s->{-fphd} ={};
my $dh ={};
my $dp =undef;
lib/ARSObject.pm view on Meta::CPAN
if ($f->{-key}) {
$act =undef;
}
next if !cfpused($s, $f);
my $fn =cfpn($s, $f);
if (!$f->{-reset}
? undef
: ref($f->{-reset}) eq 'CODE'
? &{$f->{-reset}}($s, $f)
: ref($f->{-reset}) eq 'ARRAY'
? grep {cfpvcc($s, $_)} @{$f->{-reset}}
# ??? read from URL interpreted as changed listbox
: $f->{-reset}
? cfpvcc($s, $f->{-reset})
: undef
) {
$s->{-cgi}->delete($fn);
}
my $fv =exists($f->{-computed})
view all matches for this distribution
view release on metacpan or search on metacpan
ARS/OOsup.pm view on Meta::CPAN
print "destroying connection object: " if $self->{'.debug'};
if(defined($self->{'.nologoff'}) && $self->{'.nologoff'} == 0) {
print "ars_Logoff called.\n" if $self->{'.debug'};
ars_Logoff($self->{'ctrl'}) if defined($self->{'ctrl'});
} else {
print "ars_Logoff suppressed.\n" if $self->{'.debug'};
}
}
sub ctrl {
my $this = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
applications/archive.pl view on Meta::CPAN
$reportPath = $path .'/'. $REPORTDIR;
if ($debug) {
print "\n", "<$RESULTSPATH><$pagedir><$path><$DEBUGDIR><$REPORTDIR>\n"
} else {
print EMAILREPORT "\nPlugin: '$ttest', results directory: '$path'\n";
}
$rvOpendir = opendir(DIR, $path);
if ($rvOpendir) {
applications/archive.pl view on Meta::CPAN
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub gzipOrRemoveHttpDumpDebug {
my ($gzipDebugEpoch, $removeDebugEpoch, $debugPath, $debugFilename) = @_;
my ($suffix, $extentie, $datum, $restant);
print "<$debugFilename>\n" if ($debug);
my $_debugFilename = reverse $debugFilename;
my ($_suffix, $_extentie) = reverse split(/\./, $_debugFilename, 2);
$suffix = reverse $_suffix;
$extentie = reverse $_extentie;
($datum, $restant) = split(/\-/, $suffix, 2);
if (defined $restant) {
$datum = substr($datum, 0, 8);
if ( $extentie ) {
if ( $extentie eq 'htm' ) {
if ($datum le get_yearMonthDay($gzipDebugEpoch)) {
applications/archive.pl view on Meta::CPAN
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub removeOldReportFiles {
my ($removeReportsEpoch, $removeGzipEpoch, $reportPath, $reportFilename) = @_;
my ($suffix, $prefix, $datum, $plugin, $restant, $extentie);
($suffix, $prefix) = split(/\.pl/, $reportFilename, 2);
($datum, $plugin) = split(/\-/, $suffix, 2) if (defined $suffix);
($restant, $extentie) = split(/\./, $prefix, 2) if (defined $prefix);
if ($debug) {
print "<$reportFilename>";
if ($debug >= 2) {
print " S <$suffix>, P <$prefix>" if (defined $prefix);
print " D <$datum>, P <$plugin>" if (defined $plugin);
print " R <$restant>, E <$extentie>" if (defined $extentie);
}
print "\n";
}
if (defined $restant) {
$datum = substr($datum, 0, 8);
if ($extentie eq 'pdf') {
if ($datum le get_yearMonthDay($removeReportsEpoch)) {
if ($debug) {
print "RP-<$datum><".get_yearMonthDay($removeReportsEpoch)."><$reportPath><$reportFilename>\n";
} else {
print EMAILREPORT "RP-<$datum><".get_yearMonthDay($removeReportsEpoch)."> unlink <$reportPath><$reportFilename>\n";
unlink ($reportPath.'/'.$reportFilename);
}
} elsif ($restant =~ /\-Day_\w+\-id_\d+$/) {
if ($datum le get_yearMonthDay($removeGzipEpoch)) {
if ($debug) {
print "RP-<$datum><".get_yearMonthDay($removeReportsEpoch)."><$reportPath><$reportFilename>\n";
} else {
print EMAILREPORT "RP-<$datum><".get_yearMonthDay($removeReportsEpoch)."> unlink <$reportPath><$reportFilename>\n";
view all matches for this distribution