CloudFlare-Client-v0.55.4000755001751001751 012675573017 14667 5ustar00peterpeter000000000000README100644001751001751 50612675573017 15611 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4 This archive contains the distribution CloudFlare-Client, version v0.55.4: Object Orientated Interface to CloudFlare client API This software is Copyright (c) 2016 by Peter Roberts. This is free software, licensed under: The MIT (X11) License This README file was generated by Dist::Zilla::Plugin::Readme v5.043. Changes100644001751001751 624312675573017 16250 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4Revision history for CloudFlare-Client v0.55.4 2016-03-26 - tweaks - fix commit message - test all the perls in Travis - change weaver.ini to work with changes to Test::Synopsis v0.55.3 2015-05-01 - really fix auto tagging... v0.55.2 2015-04-30 - fix auto git tagging on release v0.55.1 2015-04-30 - switch to a V-string 0.05_5 2015-04-27 - use docker containers in TravisCI - update test targets in TravisCI - start providing a cpanfile - BREAKING: switch to AUTOLOAD dispatch with all arguments as a hash - tidy code into my latest coding style - no longer clean up pre-reqs list 0.05_4 2015-02-07 - Change release tag format and travis stuff - Test::RequiresInternet for upstream existence check - Handle test dependencies better 0.05_3 2015-02-06 - Optimise "feature" usages - Add build branch - JSON::Any is deprecated, use JSON::MaybeXS instead 0.05_2 2015-02-05 - Drop auto date based prereq versions - Add TravisCI testing - Improve tests - Make all POD weaved - Rework dist.ini - Remove vestigial bovine 0.05_1 2015-02-03 - Bump to more modern Perl (5.16) - Don't load unneeded dzil modules - Use ::Git::GatherDir - Move to GitHub - Fix cpan testers failure - bits and bobs - Update repo info - git repo split 0.04 2014-08-26 - Bump to stable 0.03_9 2014-08-18 - Reinstate more liberal dep pruning - Trim more cruft from pod - Add homepage to meta - Add no indirect 'fatal' - Add git meta correctly 0.03_8 2014-08-17 - Make upstream test an author test and remove guards - Tidy imports - Immutiblise 0.03_7 2014-08-16 - Moo -> Moose because CPAN tests are still failing 0.03_6 2014-08-15 - Moo::Lax -> Moo because CPAN tests are still failing 0.03_5 2014-08-15 - Unloosen dependency removal to see if it stops CPAN tests exploding 0.03_4 2014-08-14 - No longer depend on Test::Moose or Moose - Use Moo::Lax in tests 0.03_3 2014-08-13 - Loosen dependancy removal during builds to try and group more - Require newer Type::Utils because of a bug - Moo::Lax because we don't want fatal warnings 0.03_2 2014-08-12 - Try to improve upstream test for CPAN testers - Tidy code a bit - Port to Moo - Port to use Type::Tiny 0.03_1 2014-08-08 - Fix some exception tests on older Mooses by actually escaping brackets in regexes, should make Strawberry Perl happier - Try harder to test for HTTPS connectivity when testing upstream existence and make sure it is required for install - Method::Signatures -> Kavorka - Tidy distribution a bit 0.03_0 2014-08-02 - Improve compatibility, in particular testing, for CPAN Testers - Tidy code a bit 0.03 2014-07-31 - Add a test for upstream connectivity that won't break on CPAN testers - Perl requirement dropped to 5.014 - Tidy code and make it more robust - Extensive testing of the API using Test::LWP::UserAgent - Require at least one zone as an argument to zoneCheck - Use Test::Exception rather than own stuff - Get rid of upstream testing, they fail at CPAN Testers 0.02 2014-07-16 - Fix issues that prevent CPAN indexing - Package with Dist::Zilla 0.01 2014-07-10 - First version, released on an unsuspecting world. INSTALL100644001751001751 173412675573017 16006 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4This is the Perl distribution CloudFlare-Client. Installing CloudFlare-Client is straightforward. ## Installation with cpanm If you have cpanm, you only need one line: % cpanm CloudFlare::Client If you are installing into a system-wide directory, you may need to pass the "-S" flag to cpanm, which uses sudo to install the module: % cpanm -S CloudFlare::Client ## Installing with the CPAN shell Alternatively, if your CPAN shell is set up, you should just be able to do: % cpan CloudFlare::Client ## Manual installation As a last resort, you can manually install it. Download the tarball, untar it, then build it: % perl Makefile.PL % make && make test Then install it: % make install If you are installing into a system-wide directory, you may need to run: % sudo make install ## Documentation CloudFlare-Client documentation is available as POD. You can run perldoc from a shell to read the documentation: % perldoc CloudFlare::Client LICENSE100644001751001751 221012675573017 15750 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4This software is Copyright (c) 2016 by Peter Roberts. This is free software, licensed under: The MIT (X11) License The MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. MANIFEST100644001751001751 163512675573017 16106 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.043. Changes INSTALL LICENSE MANIFEST META.json META.yml Makefile.PL README cpanfile lib/CloudFlare/Client.pm lib/CloudFlare/Client/Exception/Connection.pm lib/CloudFlare/Client/Exception/Upstream.pm lib/CloudFlare/Client/Types.pm t/00-compile.t t/01-Exception-Connection.t t/01-Exception-Upstream.t t/01-Types.t t/01-failure-connecting.t t/01-failure-upstream.t t/01-main.t t/01-success.t t/author-01-upstream-existence.t t/author-clean-namespaces.t t/author-critic.t t/author-eol.t t/author-mojibake.t t/author-no-tabs.t t/author-pod-coverage.t t/author-pod-syntax.t t/author-test-version.t t/release-cpan-changes.t t/release-dist-manifest.t t/release-distmeta.t t/release-fixme.t t/release-kwalitee.t t/release-meta-json.t t/release-minimum-version.t t/release-pod-linkcheck.t t/release-portability.t t/release-synopsis.t t/release-unused-vars.t META.yml100644001751001751 336212675573017 16225 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4--- abstract: 'Object Orientated Interface to CloudFlare client API' author: - 'Peter Roberts ' build_requires: File::Spec: '0' HTTP::Response: '0' IO::Handle: '0' IPC::Open3: '0' IPC::System::Simple: '0' JSON::Any: '0' Test::CPAN::Meta::JSON: '0' Test::Exception: '0' Test::LWP::UserAgent: '0' Test::Moose: '0' Test::More: '0' Test::RequiresInternet: '0' Test::TypeTiny: '0' Try::Tiny: '0' blib: '1.01' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 generated_by: 'Dist::Zilla version 5.043, CPAN::Meta::Converter version 2.150005' license: mit meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: CloudFlare-Client provides: CloudFlare::Client: file: lib/CloudFlare/Client.pm version: v0.55.4 CloudFlare::Client::Exception::Connection: file: lib/CloudFlare/Client/Exception/Connection.pm version: v0.55.4 CloudFlare::Client::Exception::Upstream: file: lib/CloudFlare/Client/Exception/Upstream.pm version: v0.55.4 CloudFlare::Client::Types: file: lib/CloudFlare/Client/Types.pm version: v0.55.4 requires: JSON::MaybeXS: '0' Kavorka: '0' LWP::Protocol::https: '6.02' LWP::UserAgent: '6.02' Moose: '0' MooseX::StrictConstructor: '0' Readonly: '0' Throwable::Error: '0' Type::Library: '0' Type::Utils: 0.039_12 Types::Standard: '0' indirect: '0' mro: '0' namespace::autoclean: '0' perl: '5.014' strict: '0' warnings: '0' resources: bugtracker: https://github.com/pwr22/cloudflare-client/issues homepage: https://metacpan.org/pod/CloudFlare::Client repository: git://github.com/pwr22/cloudflare-client.git version: v0.55.4 x_contributors: - 'Peter Roberts ' cpanfile100644001751001751 337512675573017 16464 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4requires "JSON::MaybeXS" => "0"; requires "Kavorka" => "0"; requires "LWP::Protocol::https" => "6.02"; requires "LWP::UserAgent" => "6.02"; requires "Moose" => "0"; requires "MooseX::StrictConstructor" => "0"; requires "Readonly" => "0"; requires "Throwable::Error" => "0"; requires "Type::Library" => "0"; requires "Type::Utils" => "0.039_12"; requires "Types::Standard" => "0"; requires "indirect" => "0"; requires "mro" => "0"; requires "namespace::autoclean" => "0"; requires "perl" => "5.014"; requires "strict" => "0"; requires "warnings" => "0"; on 'test' => sub { requires "File::Spec" => "0"; requires "HTTP::Response" => "0"; requires "IO::Handle" => "0"; requires "IPC::Open3" => "0"; requires "IPC::System::Simple" => "0"; requires "JSON::Any" => "0"; requires "Test::CPAN::Meta::JSON" => "0"; requires "Test::Exception" => "0"; requires "Test::LWP::UserAgent" => "0"; requires "Test::Moose" => "0"; requires "Test::More" => "0"; requires "Test::RequiresInternet" => "0"; requires "Test::TypeTiny" => "0"; requires "Try::Tiny" => "0"; requires "blib" => "1.01"; }; on 'configure' => sub { requires "ExtUtils::MakeMaker" => "0"; }; on 'develop' => sub { requires "Pod::Coverage::TrustPod" => "0"; requires "Test::CPAN::Changes" => "0.19"; requires "Test::CPAN::Meta" => "0"; requires "Test::CPAN::Meta::JSON" => "0.16"; requires "Test::CleanNamespaces" => "0.15"; requires "Test::EOL" => "0"; requires "Test::Kwalitee" => "1.21"; requires "Test::Mojibake" => "0"; requires "Test::More" => "0.88"; requires "Test::NoTabs" => "0"; requires "Test::Pod" => "1.41"; requires "Test::Pod::Coverage" => "1.08"; requires "Test::Pod::LinkCheck" => "0"; requires "Test::Synopsis" => "0"; requires "Test::Version" => "1"; }; META.json100644001751001751 674112675573017 16401 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4{ "abstract" : "Object Orientated Interface to CloudFlare client API", "author" : [ "Peter Roberts " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 5.043, CPAN::Meta::Converter version 2.150005", "license" : [ "mit" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "CloudFlare-Client", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "develop" : { "requires" : { "Pod::Coverage::TrustPod" : "0", "Test::CPAN::Changes" : "0.19", "Test::CPAN::Meta" : "0", "Test::CPAN::Meta::JSON" : "0.16", "Test::CleanNamespaces" : "0.15", "Test::EOL" : "0", "Test::Kwalitee" : "1.21", "Test::Mojibake" : "0", "Test::More" : "0.88", "Test::NoTabs" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", "Test::Pod::LinkCheck" : "0", "Test::Synopsis" : "0", "Test::Version" : "1" } }, "runtime" : { "requires" : { "JSON::MaybeXS" : "0", "Kavorka" : "0", "LWP::Protocol::https" : "6.02", "LWP::UserAgent" : "6.02", "Moose" : "0", "MooseX::StrictConstructor" : "0", "Readonly" : "0", "Throwable::Error" : "0", "Type::Library" : "0", "Type::Utils" : "0.039_12", "Types::Standard" : "0", "indirect" : "0", "mro" : "0", "namespace::autoclean" : "0", "perl" : "5.014", "strict" : "0", "warnings" : "0" } }, "test" : { "requires" : { "File::Spec" : "0", "HTTP::Response" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "IPC::System::Simple" : "0", "JSON::Any" : "0", "Test::CPAN::Meta::JSON" : "0", "Test::Exception" : "0", "Test::LWP::UserAgent" : "0", "Test::Moose" : "0", "Test::More" : "0", "Test::RequiresInternet" : "0", "Test::TypeTiny" : "0", "Try::Tiny" : "0", "blib" : "1.01" } } }, "provides" : { "CloudFlare::Client" : { "file" : "lib/CloudFlare/Client.pm", "version" : "v0.55.4" }, "CloudFlare::Client::Exception::Connection" : { "file" : "lib/CloudFlare/Client/Exception/Connection.pm", "version" : "v0.55.4" }, "CloudFlare::Client::Exception::Upstream" : { "file" : "lib/CloudFlare/Client/Exception/Upstream.pm", "version" : "v0.55.4" }, "CloudFlare::Client::Types" : { "file" : "lib/CloudFlare/Client/Types.pm", "version" : "v0.55.4" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/pwr22/cloudflare-client/issues" }, "homepage" : "https://metacpan.org/pod/CloudFlare::Client", "repository" : { "type" : "git", "url" : "git://github.com/pwr22/cloudflare-client.git", "web" : "https://github.com/pwr22/cloudflare-client" } }, "version" : "v0.55.4", "x_contributors" : [ "Peter Roberts " ] } t000755001751001751 012675573017 15053 5ustar00peterpeter000000000000CloudFlare-Client-v0.55.401-main.t100644001751001751 370212675573017 16544 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t#!perl -T # Aims to test basic usage of CloudFlare::Client use strict; use warnings; no indirect 'fatal'; use namespace::autoclean; use Readonly; use Try::Tiny; use Test::More; use Test::Moose; use Test::Exception; use CloudFlare::Client; plan tests => 9; Readonly my $USER => 'blah'; Readonly my $KEY => 'blah'; # Moose tests Readonly my $CLASS => 'CloudFlare::Client'; meta_ok($CLASS); for my $attr (qw/ _user _key _ua/) { has_attribute_ok( $CLASS, $attr)} lives_and { meta_ok( $CLASS->new( user => $USER, apikey => $KEY))} "Instance has meta"; # Construction lives_and { new_ok($CLASS, [ user => $USER, apikey => $KEY])} "construction with valid credentials works"; # Work around Moose versions if($Moose::VERSION >= 2.1101) { # Missing user Readonly my $MISS_ARG_E => 'Moose::Exception::AttributeIsRequired'; throws_ok { $CLASS->new( apikey => $KEY) } $MISS_ARG_E, "construction with missing user attribute throws exception"; # Missing apikey throws_ok { $CLASS->new( user => $USER) } $MISS_ARG_E, "construction with missing apikey attribute throws exception"; # Extra attr throws_ok { $CLASS->new( user => $USER, apikey => $KEY, extra => 'arg')} 'Moose::Exception::Legacy', "construction with extra attribute throws exception"} # Old Mooses throw strings else { # Missing message attr throws_ok { $CLASS->new( apikey => $KEY) } qr/^Attribute \(_user\) is required/, 'Construction with missing user attr dies'; # Missing apikey attr throws_ok { $CLASS->new( user => $USER) } qr/^Attribute \(_key\) is required/, 'Construction with missing apikey attr dies'; # Extra attr throws_ok { $CLASS->new( user => $USER, apikey => $KEY, extra => 'arg')} qr/^Found unknown attribute\(s\)/, 'construction with extra attr throws exception';} Makefile.PL100644001751001751 477312675573017 16735 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.043. use strict; use warnings; use 5.014; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "Object Orientated Interface to CloudFlare client API", "AUTHOR" => "Peter Roberts ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "CloudFlare-Client", "LICENSE" => "mit", "MIN_PERL_VERSION" => "5.014", "NAME" => "CloudFlare::Client", "PREREQ_PM" => { "JSON::MaybeXS" => 0, "Kavorka" => 0, "LWP::Protocol::https" => "6.02", "LWP::UserAgent" => "6.02", "Moose" => 0, "MooseX::StrictConstructor" => 0, "Readonly" => 0, "Throwable::Error" => 0, "Type::Library" => 0, "Type::Utils" => "0.039_12", "Types::Standard" => 0, "indirect" => 0, "mro" => 0, "namespace::autoclean" => 0, "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "File::Spec" => 0, "HTTP::Response" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "IPC::System::Simple" => 0, "JSON::Any" => 0, "Test::CPAN::Meta::JSON" => 0, "Test::Exception" => 0, "Test::LWP::UserAgent" => 0, "Test::Moose" => 0, "Test::More" => 0, "Test::RequiresInternet" => 0, "Test::TypeTiny" => 0, "Try::Tiny" => 0, "blib" => "1.01" }, "VERSION" => "v0.55.4", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "File::Spec" => 0, "HTTP::Response" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "IPC::System::Simple" => 0, "JSON::Any" => 0, "JSON::MaybeXS" => 0, "Kavorka" => 0, "LWP::Protocol::https" => "6.02", "LWP::UserAgent" => "6.02", "Moose" => 0, "MooseX::StrictConstructor" => 0, "Readonly" => 0, "Test::CPAN::Meta::JSON" => 0, "Test::Exception" => 0, "Test::LWP::UserAgent" => 0, "Test::Moose" => 0, "Test::More" => 0, "Test::RequiresInternet" => 0, "Test::TypeTiny" => 0, "Throwable::Error" => 0, "Try::Tiny" => 0, "Type::Library" => 0, "Type::Utils" => "0.039_12", "Types::Standard" => 0, "blib" => "1.01", "indirect" => 0, "mro" => 0, "namespace::autoclean" => 0, "strict" => 0, "warnings" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); 01-Types.t100644001751001751 125512675573017 16725 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t#!perl -T use strict; use warnings; no indirect 'fatal'; use namespace::autoclean; use Readonly; use Test::More; use Test::TypeTiny; use CloudFlare::Client::Types qw( CFCode ErrorCode); plan tests => 9; Readonly my $INVLD_CODE => 'E_NTSPCD'; Readonly my @CF_CODES => qw( E_UNAUTH E_INVLDINPUT E_MAXAPI); Readonly my @ERR_CODES => (undef, @CF_CODES); # Test CFCode should_pass( $_, CFCode, "$_ is a CFCode") foreach @CF_CODES; should_fail( $INVLD_CODE, CFCode, 'E_NTSPCD is not a CFCode'); # Test ErrorCode { no warnings 'uninitialized'; should_pass($_, ErrorCode, "$_ is a ErrorCode") foreach @ERR_CODES} should_fail( $INVLD_CODE, ErrorCode, 'E_NTSPCD is not an ErrorCode'); 01-success.t100644001751001751 254012675573017 17267 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t#!perl -T # This file aims to test the correct functioning of all API calls package CloudFlare::Client::Test; use strict; use warnings; use mro 'c3'; use namespace::autoclean; use Readonly; use Try::Tiny; use Moose; use MooseX::StrictConstructor; use Test::More; use Test::Exception; use Test::LWP::UserAgent; use HTTP::Response; use JSON::Any; plan tests => 1; extends 'CloudFlare::Client'; # Build a simple valid response # Response payload Readonly my $RSP_PL => { val => 1}; # Full response Readonly my $CNT_DATA => { result => 'success', response => $RSP_PL}; # Reponse from server Readonly my $CNT_RSP => HTTP::Response::->new(200); $CNT_RSP->content(JSON::Any::->objToJson($CNT_DATA)); # Override the real user agent with a mocked one # It will always return the valid response $CNT_RSP sub _buildUa { Readonly my $ua => Test::LWP::UserAgent::->new; $ua->map_response( qr{www.cloudflare.com/api_json.html}, $CNT_RSP); return $ua;} __PACKAGE__->meta->make_immutable; # Catch potential failure Readonly my $API => try { CloudFlare::Client::Test::->new( user => 'user', apikey => 'KEY')} catch { diag $_ }; # Valid values Readonly my $ZONE => 'zone.co.uk'; Readonly my $ITRVL => 20; lives_and { is_deeply $API->action( zone => $ZONE, interval => $ITRVL), $RSP_PL} "action works"; 00-compile.t100644001751001751 254012675573017 17246 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/tuse 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.054 use Test::More; plan tests => 4 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'CloudFlare/Client.pm', 'CloudFlare/Client/Exception/Connection.pm', 'CloudFlare/Client/Exception/Upstream.pm', 'CloudFlare/Client/Types.pm' ); # no fake home requested my $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib'; use File::Spec; use IPC::Open3; use IO::Handle; open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my @warnings; for my $lib (@module_files) { # see L my $stderr = IO::Handle->new; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { require blib; blib->VERSION('1.01') }; if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } is(scalar(@warnings), 0, 'no warnings found') or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING}; author-eol.t100644001751001751 137712675573017 17467 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t BEGIN { unless ($ENV{AUTHOR_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for testing by the author'); } } use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::EOL 0.18 use Test::More 0.88; use Test::EOL; my @files = ( 'lib/CloudFlare/Client.pm', 'lib/CloudFlare/Client/Exception/Connection.pm', 'lib/CloudFlare/Client/Exception/Upstream.pm', 'lib/CloudFlare/Client/Types.pm', 't/00-compile.t', 't/01-Exception-Connection.t', 't/01-Exception-Upstream.t', 't/01-Types.t', 't/01-failure-connecting.t', 't/01-failure-upstream.t', 't/01-main.t', 't/01-success.t' ); eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files; done_testing; author-critic.t100644001751001751 66612675573017 20145 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t#!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for testing by the author'); } } use strict; use warnings; use Test::More; use English qw(-no_match_vars); eval "use Test::Perl::Critic"; plan skip_all => 'Test::Perl::Critic required to criticise code' if $@; Test::Perl::Critic->import( -profile => "perlcritic.rc" ) if -e "perlcritic.rc"; all_critic_ok(); release-fixme.t100644001751001751 43412675573017 20107 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } # This test is generated by Dist::Zilla::Plugin::Test::Fixme use strict; use warnings; use Test::Fixme; run_tests(); author-no-tabs.t100644001751001751 134512675573017 20246 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t BEGIN { unless ($ENV{AUTHOR_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for testing by the author'); } } use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.15 use Test::More 0.88; use Test::NoTabs; my @files = ( 'lib/CloudFlare/Client.pm', 'lib/CloudFlare/Client/Exception/Connection.pm', 'lib/CloudFlare/Client/Exception/Upstream.pm', 'lib/CloudFlare/Client/Types.pm', 't/00-compile.t', 't/01-Exception-Connection.t', 't/01-Exception-Upstream.t', 't/01-Types.t', 't/01-failure-connecting.t', 't/01-failure-upstream.t', 't/01-main.t', 't/01-success.t' ); notabs_ok($_) foreach @files; done_testing; author-mojibake.t100644001751001751 40212675573017 20435 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t#!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for testing by the author'); } } use strict; use warnings qw(all); use Test::More; use Test::Mojibake; all_files_encoding_ok(); release-synopsis.t100644001751001751 31612675573017 20665 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::Synopsis; all_synopsis_ok(); release-distmeta.t100644001751001751 43012675573017 20605 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } # This file was automatically generated by Dist::Zilla::Plugin::MetaTests. use Test::CPAN::Meta; meta_yaml_ok(); release-kwalitee.t100644001751001751 53312675573017 20604 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } # this test was generated with Dist::Zilla::Plugin::Test::Kwalitee 2.12 use strict; use warnings; use Test::More 0.88; use Test::Kwalitee 1.21 'kwalitee_ok'; kwalitee_ok(); done_testing; author-pod-syntax.t100644001751001751 50312675573017 20764 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t#!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for testing by the author'); } } # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); release-meta-json.t100644001751001751 32212675573017 20670 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::CPAN::Meta::JSON; meta_json_ok(); 01-failure-upstream.t100644001751001751 272412675573017 21110 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t#!perl -T # This file aims to test the failure of an API call package CloudFlare::Client::Test; use strict; use warnings; no indirect 'fatal'; use namespace::autoclean; use mro 'c3'; use Readonly; use Try::Tiny; use Moose; use MooseX::StrictConstructor; use Test::More; use Test::Exception; use Test::LWP::UserAgent; use HTTP::Response; use JSON::Any; plan tests => 1; extends 'CloudFlare::Client'; # Build a simple error response # Error code Readonly my $ERR_CODE => 'E_UNAUTH'; # Full response content Readonly my $CNT => { result => 'error', err_code => $ERR_CODE, msg => 'something',}; # Reponse from server Readonly my $RSP => HTTP::Response::->new(200); $RSP->content(JSON::Any::->objToJson($CNT)); # Override the real user agent with a mocked one # It will always return the error response $RSP sub _buildUa { Readonly my $ua => Test::LWP::UserAgent::->new; $ua->map_response( qr{www.cloudflare.com/api_json.html}, $RSP); return $ua;} __PACKAGE__->meta->make_immutable; # Test upstream failure # Catch potential failure Readonly my $API => try { CloudFlare::Client::Test::->new( user => 'user', apikey => 'KEY')} catch { diag $_ }; # Valid values Readonly my $ZONE => 'zone.co.uk'; Readonly my $ITRVL => 20; throws_ok { $API->action( z => $ZONE, interval => $ITRVL )} 'CloudFlare::Client::Exception::Upstream', "methods die with an invalid response"; release-unused-vars.t100644001751001751 62012675573017 21250 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::More 0.96 tests => 1; eval { require Test::Vars }; SKIP: { skip 1 => 'Test::Vars required for testing for unused vars' if $@; Test::Vars->import; subtest 'unused vars' => sub { all_vars_ok(); }; }; release-portability.t100644001751001751 53512675573017 21343 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use strict; use warnings; use Test::More; eval 'use Test::Portability::Files'; plan skip_all => 'Test::Portability::Files required for testing portability' if $@; run_tests(); author-pod-coverage.t100644001751001751 56512675573017 21241 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t#!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for testing by the author'); } } # This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests. use Test::Pod::Coverage 1.08; use Pod::Coverage::TrustPod; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); author-test-version.t100644001751001751 107112675573017 21341 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t BEGIN { unless ($ENV{AUTHOR_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for testing by the author'); } } use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::Version 1.05 use Test::Version; my @imports = qw( version_all_ok ); my $params = { is_strict => 0, has_version => 1, multiple => 0, }; push @imports, $params if version->parse( $Test::Version::VERSION ) >= version->parse('1.002'); Test::Version->import(@imports); version_all_ok; done_testing; CloudFlare000755001751001751 012675573017 17376 5ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/libClient.pm100644001751001751 1250112675573017 21331 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/lib/CloudFlarepackage CloudFlare::Client; # ABSTRACT: Object Orientated Interface to CloudFlare client API # Or Kavorka will explode use 5.014; use strict; use warnings; no indirect 'fatal'; use namespace::autoclean; use mro 'c3'; use Readonly; use Moose; use MooseX::StrictConstructor; use Types::Standard 'Str'; use CloudFlare::Client::Types 'LWPUserAgent'; use Kavorka; use CloudFlare::Client::Exception::Connection; use CloudFlare::Client::Exception::Upstream; use LWP::UserAgent 6.02; # This isn't used directly but we want the dependency use LWP::Protocol::https 6.02; use JSON::MaybeXS; our $VERSION = 'v0.55.4'; # VERSION # CF credentials has '_user' => ( is => 'ro', isa => Str, required => 1, init_arg => 'user',); has '_key' => ( is => 'ro', isa => Str, required => 1, init_arg => 'apikey',); Readonly my $UA_STRING => "CloudFlare::Client/$CloudFlare::Client::VERSION"; sub _buildUa { Readonly my $ua => LWP::UserAgent::->new; $ua->agent($UA_STRING); return $ua;} has '_ua' => ( is => 'ro', isa => LWPUserAgent, init_arg => undef, builder => '_buildUa',); # Calls through to the CF API, can throw exceptions under ::Exception:: Readonly my $CF_URL => 'https://www.cloudflare.com/api_json.html'; method _apiCall ( $act is ro, %args is ro ) { # query cloudflare Readonly my $res => $self->_ua->post( $CF_URL, { %args, # global args # override user specified tkn => $self->_key, email => $self->_user, a => $act,}); # Handle connection errors CloudFlare::Client::Exception::Connection::->throw( status => $res->status_line, message => 'HTTPS request failed',) unless $res->is_success; # Handle errors from CF Readonly my $info => decode_json($res->decoded_content); CloudFlare::Client::Exception::Upstream::->throw( errorCode => $info->{err_code}, message => $info->{msg},) unless $info->{result} eq 'success'; return $info->{response};} # all API calls are implemented through autoloading, the action is the method method AUTOLOAD { our $AUTOLOAD; # pull action out of f.q. method name my $act = $AUTOLOAD =~ s/.*:://r; return $self->_apiCall( $act, @_ );} __PACKAGE__->meta->make_immutable; 1; # End of CloudFlare::Client __END__ =pod =encoding UTF-8 =head1 NAME CloudFlare::Client - Object Orientated Interface to CloudFlare client API =head1 VERSION version v0.55.4 =for test_synopsis my ( $CF_USER, $CF_KEY, $ZONE, $INTERVAL); =head1 SYNOPSIS use CloudFlare::Client; my $api = CloudFlare::Client::->new( user => $CF_USER, apikey => $CF_KEY,); $api->stats( z => $ZONE, interval => $INTERVAL); ... =head1 OVERVIEW Please see the documentation at L for information on the CloudFlare client API and its arguments. API actions are mapped to methods of the same name and arguments are passed in as a hash with keys as given in the docs Successful API calls return the response section from the upstream JSON API. Failures for whatever reason throw exceptions under the CloudFlare::Client::Exception:: namespace =head1 METHODS =head2 new Construct a new API object my $api = CloudFlare::Client::->new( user => $CF_USER, apikey => $CF_KEY); =head1 SEE ALSO Please see those modules/websites for more information related to this module. =over 4 =item * L =item * L =back =for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan =head1 SUPPORT =head2 Perldoc You can find documentation for this module with the perldoc command. perldoc CloudFlare::Client =head2 Websites The following websites have more information about this module, and may be of help to you. As always, in addition to those websites please use your favorite search engine to discover more resources. =over 4 =item * MetaCPAN A modern, open-source CPAN search engine, useful to view POD in HTML format. L =back =head2 Email You can email the author of this module at C asking for help with any problems you have. =head2 Source Code The code is open to the world, and available for you to hack on. Please feel free to browse it and play with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull from your repository :) L git clone git://github.com/pwr22/cloudflare-client.git =head1 BUGS Please report any bugs or feature requests on the bugtracker website https://github.com/pwr22/cloudflare-client/issues When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 ACKNOWLEDGEMENTS Thanks to CloudFlare providing an awesome free service with an API =head1 CONTRIBUTOR =for stopwords Peter Roberts Peter Roberts =head1 AUTHOR Peter Roberts =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Peter Roberts. This is free software, licensed under: The MIT (X11) License =cut release-cpan-changes.t100644001751001751 52112675573017 21323 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use strict; use warnings; use Test::More 0.96 tests => 2; use_ok('Test::CPAN::Changes'); subtest 'changes_ok' => sub { changes_file_ok('Changes'); }; done_testing(); 01-Exception-Upstream.t100644001751001751 234112675573017 21352 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t#!perl -T use strict; use warnings; no indirect 'fatal'; use namespace::autoclean; use Readonly; use Test::More; use Test::Exception; use CloudFlare::Client::Exception::Upstream; plan tests => 7; Readonly my $MSG => 'Doesn\'t Matter'; # Test for superclass Readonly my $CLASS => 'CloudFlare::Client::Exception::Upstream'; isa_ok( $CLASS, 'Throwable::Error', 'Class superclass correct'); # Test for errorCode accessor can_ok( $CLASS, 'errorCode'); # Construction # Valid error code lives_and { new_ok( $CLASS => [ message => $MSG, errorCode => 'E_MAXAPI'])} "construction with valid EC works"; # No error code lives_and { new_ok( $CLASS => [ message => $MSG])} "construction with no EC works"; # Invalid error code throws_ok { $CLASS->new( message => $MSG, errorCode => 'E_NOTSPECD')} qr/Attribute \(errorCode\) does not pass the type constraint/, 'construction with invalid EC fails'; # Missing message attr throws_ok { $CLASS->new } qr/Attribute \(message\) is required/, 'Construction with missing message attr dies'; # Extra attr throws_ok { $CLASS->new(message => $MSG, extra => 'arg')} qr/^Found unknown attribute\(s\)/, 'construction with extra attr throws exception'; 01-failure-connecting.t100644001751001751 173212675573017 21375 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t#!perl -T # This file aims to test the failure of an API call when a # connection cannot be made package CloudFlare::Client::Test; use strict; use warnings; no indirect 'fatal'; use namespace::autoclean; use mro 'c3'; use Readonly; use Try::Tiny; use Moose; use MooseX::StrictConstructor; use Test::More; use Test::Exception; use Test::LWP::UserAgent; plan tests => 1; extends 'CloudFlare::Client'; # Override the real user agent with a mocked one # It will always fail to connect sub _buildUa { Test::LWP::UserAgent::->new } __PACKAGE__->meta->make_immutable; # Test upstream failures # Catch potential failure Readonly my $API => try { CloudFlare::Client::Test::->new( user => 'user', apikey => 'KEY')} catch { diag $_ }; # Valid values Readonly my $ZONE => 'zone.co.uk'; Readonly my $ITRVL => 20; throws_ok { $API->action( z => $ZONE, interval => $ITRVL )} 'CloudFlare::Client::Exception::Connection', "methods die with a connection error"; release-pod-linkcheck.t100644001751001751 77512675573017 21522 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use strict; use warnings; use Test::More; foreach my $env_skip ( qw( SKIP_POD_LINKCHECK ) ){ plan skip_all => "\$ENV{$env_skip} is set, skipping" if $ENV{$env_skip}; } eval "use Test::Pod::LinkCheck"; if ( $@ ) { plan skip_all => 'Test::Pod::LinkCheck required for testing POD'; } else { Test::Pod::LinkCheck->new->all_pod_ok; } release-dist-manifest.t100644001751001751 46612675573017 21553 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::More; eval "use Test::DistManifest"; plan skip_all => "Test::DistManifest required for testing the manifest" if $@; manifest_ok(); 01-Exception-Connection.t100644001751001751 225412675573017 21654 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t#!perl -T use strict; use warnings; no indirect 'fatal'; use namespace::autoclean; use Test::More; use Test::Moose; use Test::Exception; use Try::Tiny; use Readonly; use CloudFlare::Client::Exception::Connection; plan tests => 8; # Test for superclass Readonly my $CLASS => 'CloudFlare::Client::Exception::Connection'; isa_ok( $CLASS, 'Throwable::Error', 'Class superclass'); # Test for status accessor can_ok( $CLASS, 'status'); # Tests for moose Readonly my $MSG => 'Doesn\'t Matter'; Readonly my $STATUS => '404'; meta_ok($CLASS); has_attribute_ok( $CLASS, 'status', 'status attribute'); my $e = try { $CLASS->new( message => $MSG, status => $STATUS)}; meta_ok($e); # Construction # with status lives_and { new_ok( $CLASS => [ message => $MSG, status => $STATUS])} "construction works with status attr"; # Missing message attr throws_ok { $CLASS->new(status => $STATUS)} qr/^Attribute \(message\) is required/, 'Construction with missing message attr dies'; # Extra attr throws_ok { $CLASS->new( message => $MSG, status => $STATUS, extra => 'arg')} qr/^Found unknown attribute\(s\)/, 'construction with extra attr throws exception'; release-minimum-version.t100644001751001751 52612675573017 22137 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::More; eval "use Test::MinimumVersion"; plan skip_all => "Test::MinimumVersion required for testing minimum versions" if $@; all_minimum_version_from_metayml_ok(); author-clean-namespaces.t100644001751001751 61212675573017 22056 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t BEGIN { unless ($ENV{AUTHOR_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for testing by the author'); } } use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::CleanNamespaces 0.006 use Test::More 0.94; use Test::CleanNamespaces 0.15; subtest all_namespaces_clean => sub { all_namespaces_clean() }; done_testing; Client000755001751001751 012675573017 20614 5ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/lib/CloudFlareTypes.pm100644001751001751 474412675573017 22427 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/lib/CloudFlare/Clientpackage CloudFlare::Client::Types; # ABSTRACT: Types for Cloudflare::Client use strict; use warnings; no indirect 'fatal'; use namespace::autoclean; use Type::Library -base, -declare => qw( CFCode ErrorCode); # Theres a bug about using undef as a hashref before this version use Type::Utils 0.039_12 -all; use Types::Standard qw( Enum Maybe); use Readonly; our $VERSION = 'v0.55.4'; # VERSION class_type 'LWP::UserAgent'; declare CFCode, as Enum[qw( E_UNAUTH E_INVLDINPUT E_MAXAPI)]; declare ErrorCode, as Maybe[CFCode]; 1; # End of CloudFlare::Client::Types __END__ =pod =encoding UTF-8 =head1 NAME CloudFlare::Client::Types - Types for Cloudflare::Client =head1 VERSION version v0.55.4 =head1 SYNOPSIS use CloudFlare::Client::Types 'ErrorCode'; =head1 SEE ALSO Please see those modules/websites for more information related to this module. =over 4 =item * L =back =for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan =head1 SUPPORT =head2 Perldoc You can find documentation for this module with the perldoc command. perldoc CloudFlare::Client =head2 Websites The following websites have more information about this module, and may be of help to you. As always, in addition to those websites please use your favorite search engine to discover more resources. =over 4 =item * MetaCPAN A modern, open-source CPAN search engine, useful to view POD in HTML format. L =back =head2 Email You can email the author of this module at C asking for help with any problems you have. =head2 Source Code The code is open to the world, and available for you to hack on. Please feel free to browse it and play with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull from your repository :) L git clone git://github.com/pwr22/cloudflare-client.git =head1 BUGS Please report any bugs or feature requests on the bugtracker website https://github.com/pwr22/cloudflare-client/issues When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHOR Peter Roberts =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Peter Roberts. This is free software, licensed under: The MIT (X11) License =cut author-01-upstream-existence.t100644001751001751 133512675573017 22745 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/t#!perl -T BEGIN { unless ($ENV{AUTHOR_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for testing by the author'); } } use strict; use warnings; no indirect 'fatal'; use namespace::autoclean; use Readonly; use Test::More; use Test::Exception; use Test::RequiresInternet; use CloudFlare::Client; plan tests => 1; # Check we can hit the service and it fails our call throws_ok { Readonly my $api => CloudFlare::Client::->new( user => 'user', apikey => 'KEY'); # Picked because takes no args $api->zoneLoadMulti } 'CloudFlare::Client::Exception::Upstream', 'Upstream service exists and responds' Exception000755001751001751 012675573017 22552 5ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/lib/CloudFlare/ClientUpstream.pm100644001751001751 660012675573017 25052 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/lib/CloudFlare/Client/Exceptionpackage CloudFlare::Client::Exception::Upstream; # ABSTRACT: Upstream CloudFlare API Exception use strict; use warnings; no indirect 'FATAL'; use namespace::autoclean; use mro 'c3'; use Readonly; use Moose; use MooseX::StrictConstructor; use CloudFlare::Client::Types 'ErrorCode'; our $VERSION = 'v0.55.4'; # VERSION extends 'Throwable::Error'; has errorCode => ( is => 'ro', isa => ErrorCode,); __PACKAGE__->meta->make_immutable; 1; # End of CloudFlare::Client::Exception::Upstream __END__ =pod =encoding UTF-8 =head1 NAME CloudFlare::Client::Exception::Upstream - Upstream CloudFlare API Exception =head1 VERSION version v0.55.4 =head1 SYNOPSIS use CloudFlare::Client::Exception::Upstream; CloudFlare::Client::Exception::Upstream::->throw( message => 'Bad things occured', errorCode => 'E_MAXAPI', ); my $e = CloudFlare::Client::Exception::Upstream::->new( message => 'Bad things happened', errorcode => 'E_MAXAPI', ); $e->throw; =head1 ATTRIBUTES =head2 message The error message thrown upstream, readonly =head2 errorCode The error code thrown upstream, readonly. Valid values are undef, E_UNAUTH, E_INVLDINPUT or E_MAXAPI. Readonly =head1 METHODS =head2 throw On the class, throw a new exception CloudFlare::Client::Exception::Upstream::->throw( message => 'Bad things occured', errorCode => 'E_MAXAPI', ); ... On an instance, throw that exception $e->throw; =head2 new Construct a new exception my $e = CloudFlare::Client::Exception::Upstream::->new( message => 'Bad things happened', errorcode => 'E_MAXAPI', ); =head1 SEE ALSO Please see those modules/websites for more information related to this module. =over 4 =item * L =back =for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan =head1 SUPPORT =head2 Perldoc You can find documentation for this module with the perldoc command. perldoc CloudFlare::Client =head2 Websites The following websites have more information about this module, and may be of help to you. As always, in addition to those websites please use your favorite search engine to discover more resources. =over 4 =item * MetaCPAN A modern, open-source CPAN search engine, useful to view POD in HTML format. L =back =head2 Email You can email the author of this module at C asking for help with any problems you have. =head2 Source Code The code is open to the world, and available for you to hack on. Please feel free to browse it and play with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull from your repository :) L git clone git://github.com/pwr22/cloudflare-client.git =head1 BUGS Please report any bugs or feature requests on the bugtracker website https://github.com/pwr22/cloudflare-client/issues When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHOR Peter Roberts =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Peter Roberts. This is free software, licensed under: The MIT (X11) License =cut Connection.pm100644001751001751 652512675573017 25357 0ustar00peterpeter000000000000CloudFlare-Client-v0.55.4/lib/CloudFlare/Client/Exceptionpackage CloudFlare::Client::Exception::Connection; # ABSTRACT: CloudFlare API Connection Exception use strict; use warnings; no indirect 'fatal'; use namespace::autoclean; use mro 'c3'; use Readonly; use Moose; use MooseX::StrictConstructor; use Types::Standard 'Str'; our $VERSION = 'v0.55.4'; # VERSION extends 'Throwable::Error'; has status => ( is => 'ro', isa => Str, required => 1,); __PACKAGE__->meta->make_immutable; 1; # End of CloudFlare::Client::Exception::Connection __END__ =pod =encoding UTF-8 =head1 NAME CloudFlare::Client::Exception::Connection - CloudFlare API Connection Exception =head1 VERSION version v0.55.4 =head1 SYNOPSIS use CloudFlare::Client::Exception::Connection; CloudFlare::Client::Exception::Connection::->throw( message => 'HTTPS connection failure', status => '404', ); my $e = CloudFlare::Client::Exception::Connection::->new( message => 'HTTPS connection failure', status => '404', ); $e->throw; =head1 ATTRIBUTES =head2 message The error message thrown upstream, readonly =head2 status The status code for the connection failure, readonly =head1 METHODS =head2 throw On the class, throw a new exception CloudFlare::Client::Exception::Connection::->throw( message => 'HTTPS connection failure', status => '404', ); ... On an instance, throw that exception $e->throw; =head2 new Construct a new exception my $e = CloudFlare::Client::Exception::Connection::->throw( message => 'HTTPS connection failure', errorcode => '404', ); =head1 SEE ALSO Please see those modules/websites for more information related to this module. =over 4 =item * L =back =for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan =head1 SUPPORT =head2 Perldoc You can find documentation for this module with the perldoc command. perldoc CloudFlare::Client =head2 Websites The following websites have more information about this module, and may be of help to you. As always, in addition to those websites please use your favorite search engine to discover more resources. =over 4 =item * MetaCPAN A modern, open-source CPAN search engine, useful to view POD in HTML format. L =back =head2 Email You can email the author of this module at C asking for help with any problems you have. =head2 Source Code The code is open to the world, and available for you to hack on. Please feel free to browse it and play with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull from your repository :) L git clone git://github.com/pwr22/cloudflare-client.git =head1 BUGS Please report any bugs or feature requests on the bugtracker website https://github.com/pwr22/cloudflare-client/issues When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHOR Peter Roberts =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Peter Roberts. This is free software, licensed under: The MIT (X11) License =cut