Email::ConstantContact::Activity - Internal class to interact with ConstantContact Activity Objects.


Email-ConstantContact documentation Contained in the Email-ConstantContact distribution.

Index


Code Index:

NAME

Top

Email::ConstantContact::Activity - Internal class to interact with ConstantContact Activity Objects.

VERSION

Top

Version 0.05

SYNOPSIS

Top

Activities are asynchronous requests used when the dataset is too large to be handled gracefully in realtime. For example, bulk uploads or downloads of contact data.

This module is not typically used directly, but internally by the main Email::ConstantContact object for processing requests.

    use Email::ConstantContact;

	my $apikey = 'ABCDEFG1234567';
    my $username = 'mycompany';
	my $password = 'topsecret';

    my $cc = new Email::ConstantContact($apikey, $username, $password);
    my @recent_activities = $cc->activities();

    foreach my $activity (@recent_activities) {
        print "Found recent activity, Type= ", $activity->{Type}, "\n";
	}

AUTHOR

Top

Adam Rich, <arich at cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-email-constantcontact at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Email-ConstantContact. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Email::ConstantContact::Activity




You can also look for information at:

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Email-ConstantContact

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Email-ConstantContact

* CPAN Ratings

http://cpanratings.perl.org/d/Email-ConstantContact

* Search CPAN

http://search.cpan.org/dist/Email-ConstantContact/

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


Email-ConstantContact documentation Contained in the Email-ConstantContact distribution.
package Email::ConstantContact::Activity;

use warnings;
use strict;
use Carp;
use LWP::UserAgent;
use HTTP::Request::Common qw(POST GET);
use XML::Simple;
use XML::Writer;
use POSIX qw( strftime );

use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);

require Exporter;

@ISA = qw(Exporter);
@EXPORT = qw( );

$VERSION = '0.05';


my @fields = qw (
	id Type Status FileName TransactionCount Error RunStartTime RunFinishTime InsertTime
);

sub new {
	my $class	= shift;
	my $ccobj	= shift;
	my $data	= shift;

	my $self  = {
		'_cc'		=> $ccobj,
		'Errors'	=> []
	};

	foreach my $field (@fields) {
		$self->{$field} = $data->{'content'}->{'Activity'}->{$field};
	}

	if (exists($data->{'link'}) && ref($data->{'link'})) {
		foreach my $link (@{$data->{'link'}}) {
			if ($link->{'rel'} eq 'edit') {
				$self->{'link'} = $link->{'href'};
			}
		}
	}

	if (exists($data->{'content'}->{'Activity'}->{'Errors'}) 
		&& ref($data->{'content'}->{'Activity'}->{'Errors'})) {
		$self->Errors = $data->{'content'}->{'Activity'}->{'Errors'};
	}

	bless ($self, $class);
	return $self;
}

1; # End of Email::ConstantContact::Activity