| Net-Akamai documentation | Contained in the Net-Akamai distribution. |
Net::Akamai::RequestData - Object to hold request data
Data container for an akamai purge request
akamai login user
password of the akamai user
akamai network (do not change)
akamai purge type (cpcode|arl)
default akamai purge action (invalidate|remove)
email purge request will be sent to
array of urls to purge
array of soap options
John Goulah <jgoulah@cpan.org>
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
| Net-Akamai documentation | Contained in the Net-Akamai distribution. |
package Net::Akamai::RequestData; use Moose; use MooseX::AttributeHelpers; use SOAP::Lite; use Net::Akamai::RequestData::Types;
has 'user' => ( is => 'rw', isa => 'Str', required => 1, );
has 'pwd' => ( is => 'rw', isa => 'Str', required => 1, );
has 'network' => ( is => 'ro', isa => 'Str', default => 'ff', );
has 'ptype' => ( is => 'ro', isa => 'Net::Akamai::RequestData::Types::PurgeType', default => 'arl', predicate => 'has_ptype', );
has 'action' => ( is => 'ro', isa => 'Net::Akamai::RequestData::Types::PurgeAction', predicate => 'has_action', default => 'remove', );
has 'email' => ( is => 'rw', isa => 'Str', predicate => 'has_email', );
has 'urls' => ( metaclass => 'Collection::Array', is => 'rw', isa => 'ArrayRef[Object]', default => sub { [] }, provides => { 'push' => 'add_url', 'pop' => 'remove_last_url', }, ); around 'add_url' => sub { my $next = shift; my $self = shift; my $arg = shift; my $soap_data = SOAP::Data->type('string')->value($arg); $self->$next($soap_data, @_); };
has 'options' => ( is => 'rw', isa => 'Net::Akamai::RequestData::Types::PurgeOptionsArrayRef', coerce => 1, lazy_build => 1, ); sub _build_options { my $self = shift; my @ret; push @ret, "email-notification=".$self->email if $self->has_email; push @ret, "type=".$self->ptype; push @ret, "action=".$self->action; # This terminates this list of options and insures the options array is not null push @ret, ""; \@ret; };
1;