Chimp/List.pm untested

filter: Statementstmt 0.0% 0 / 76 Branchbran n/a Conditioncond 0.0% 0 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 25 Podpod 0.0% 0 / 21 totaltotal 0.0% 0 / 128 CC 1 SCAR 6.9
CC
1
Cov
0%
_call
2.0
abuse_reports
2.0
batch_subscribe
2.0
CRAP 2.0
1 package Mail::Chimp::List;
2 use strict;
3 use warnings;
4 use Moose;
5 use MooseX::Types::DateTimeX qw(DateTime);
6 our $VERSION = '0.2.1';
7  
8  
9 has '_api' => (is => 'ro', isa => 'Mail::Chimp::API');
10 has 'id' => (is => 'ro', isa => 'Str');
11 has 'web_id' => (is => 'ro', isa => 'Int');
12 has 'name' => (is => 'ro', isa => 'Str');
13 has 'date_created' => (is => 'ro', isa => DateTime, coerce => 1);
14 has 'member_count' => (is => 'ro', isa => 'Int');
15 has 'unsubscribe_count' => (is => 'ro', isa => 'Int');
16 has 'email_type_option' => (is => 'ro', isa => 'Bool');
17 has 'default_from_name' => (is => 'ro', isa => 'Str');
18 has 'default_from_email' => (is => 'ro', isa => 'Str');
19 has 'default_subject' => (is => 'ro', isa => 'Str');
20 has 'default_language' => (is => 'ro', isa => 'Str');
21 has 'list_rating' => (is => 'ro', isa => 'Num');
22 has 'member_count_since_send' => (is => 'ro', isa => 'Int');
23 has 'unsubscribe_since_send_count' => (is => 'ro', isa => 'Int');
24 has 'cleaned_count_since_send' => (is => 'ro', isa => 'Int');
25  
26  
27 sub _call {
28 my ( $self, $method, @args ) = @_;
29 return $self->_api->_call( $method, $self->_api->apikey, $self->id, @args );
30 }
31  
32 sub abuse_reports {
33 my ( $self, $start, $limit, $since ) = @_;
34 my $reports = $self->_call( 'listAbuseReports', $start, $limit, $since );
35 return [ map { Mail::Chimp::AbuseReport->new( _api => $self->api, %$_) } @$reports ];
36 }
37  
38 sub batch_subscribe {
39 my ( $self, $batch, $double_optin, $update_existing, $replace_interests ) = @_;
40 return $self->_call( 'listBatchSubscribe', $batch, $double_optin, $update_existing, $replace_interests );
41 }
42  
43 sub batch_unsubscribe {
44 my ( $self, $addresses, $delete_member, $send_goodbye, $send_notify ) = @_;
45 return $self->_call( 'listBatchUnsubscribe', $addresses, $delete_member, $send_goodbye, $send_notify );
46 }
47  
48 sub growth_history {
49 my ( $self ) = @_;
50 return $self->_call( 'listGrowthHistory' );
51 }
52  
53 sub add_interest_group {
54 my ( $self, $name ) = @_;
55 return $self->_call( 'listInterestGroupAdd', $name );
56 }
57  
58 sub delete_interest_group {
59 my ( $self, $name ) = @_;
60 return $self->_call( 'listInterestGroupDel', $name );
61 }
62  
63 sub update_interest_group {
64 my ( $self, $old_name, $new_name ) = @_;
65 return $self->_call( 'listInterestGroupDel', $old_name, $new_name );
66 }
67  
68 sub interest_groups {
69 my ( $self ) = @_;
70 return $self->_call( 'listInterestGroups' );
71 }
72  
73 sub member_info {
74 my ( $self, $email ) = @_;
75 return $self->_call( 'listMemberInfo', $email );
76 }
77  
78 sub members {
79 my ( $self, $status, $since, $start, $limit ) = @_;
80 return $self->_call( 'listMembers', $status, $since, $start, $limit );
81 }
82  
83 sub add_merge_var {
84 my ( $self, $name, $description, $options ) = @_;
85 return $self->_call( 'listMergeVarAdd', uc $name, $description, $options );
86 }
87  
88 sub delete_merge_var {
89 my ( $self, $name ) = @_;
90 return $self->_call( 'listMergeVarDel', uc $name );
91 }
92  
93 sub update_merge_var {
94 my ( $self, $name ) = @_;
95 return $self->_call( 'listMergeVarUpdate', uc $name );
96 }
97  
98 sub merge_vars {
99 my ( $self ) = @_;
100 return $self->_call( 'listMergeVars' );
101 }
102  
103 sub subscribe_address {
104 my ( $self, $email, $merge_vars ) = @_;
105 $merge_vars ||= {};
106 return $self->_call( 'listSubscribe', $email, $merge_vars );
107 }
108  
109 sub unsubscribe_address {
110 my ( $self, $email, $delete ) = @_;
111 return $self->_call( 'listUnsubscribe', $email, $delete );
112 }
113  
114 sub update_member {
115 my ( $self, $email, $merge_vars, $email_type, $replace_interests ) = @_;
116 $merge_vars ||= {};
117 return $self->_call( 'listUpdateMember', $email, $merge_vars, $email_type, $replace_interests );
118 }
119  
120 sub webhooks {
121 my ( $self ) = @_;
122 return $self->_call('listWebhooks' );
123 }
124  
125 sub add_webhook {
126 my ( $self, $url, $actions, $sources ) = @_;
127 return $self->_call( 'listWebhookAdd', $url, $actions, $sources );
128 }
129  
130 sub delete_webhook {
131 my ( $self, $url, $actions, $sources ) = @_;
132 return $self->_call( 'listWebhookDel', $url );
133 }
134  
135 1;