File Coverage

blib/lib/Paymill/REST/Item/Offer.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Paymill::REST::Item::Offer;
2              
3 9     9   6745 use Moose;
  9         25  
  9         70  
4 9     9   62202 use MooseX::Types::DateTime::ButMaintained qw(DateTime);
  9         23  
  9         112  
5              
6             with 'Paymill::REST::Operations::Delete';
7              
8             has _factory => (is => 'ro', isa => 'Object');
9              
10             has id => (is => 'ro', isa => 'Str');
11             has name => (is => 'ro', isa => 'Str', required => 1);
12             has amount => (is => 'ro', isa => 'Int', required => 1);
13             has currency => (is => 'ro', isa => 'Str', required => 1);
14             has interval => (is => 'ro', isa => 'Str', required => 1);
15             has trial_period_days => (is => 'ro', isa => 'Int|Undef');
16             has created_at => (is => 'ro', isa => DateTime, coerce => 1);
17             has updated_at => (is => 'ro', isa => DateTime, coerce => 1);
18             has subscription_count => (is => 'ro', isa => 'HashRef');
19             has app_id => (is => 'ro', isa => 'Undef|Str');
20              
21 9     9   19253 no Moose;
  9         26  
  9         54  
22             1;
23             __END__
24              
25             =encoding utf-8
26              
27             =head1 NAME
28              
29             Paymill::REST::Item::Offer - Item class for an offer
30              
31             =head1 SYNOPSIS
32              
33             my $offer_api = Paymill::REST::Offers->new;
34             $offer = $offer_api->find('offer_lk2j34h5lk34h5lkjh2');
35              
36             say $offer->name; # Prints name assigned to the offer
37              
38             =head1 DESCRIPTION
39              
40             Represents an offer with all attributes.
41              
42             =head1 ATTRIBUTES
43              
44             =over 4
45              
46             =item id
47              
48             String containing the identifier of the client
49              
50             =item name
51              
52             String containing the assigned name
53              
54             =item amount
55              
56             Integer containing the assigned amount
57              
58             =item currency
59              
60             String containing the currency in which the amount will be charged
61              
62             =item interval
63              
64             String representing the interval in which the amount will be charged
65              
66             =item trial_period_days
67              
68             Integer representing the defined trial days
69              
70             =item subscription_count
71              
72             Hashref with keys C<active> and C<inactive>
73              
74             =item created_at
75              
76             L<DateTime> object indicating the date of the creation as returned by the API
77              
78             =item updated_at
79              
80             L<DateTime> object indicating the date of the last update as returned by the API
81              
82             =item app_id
83              
84             String representing the app id that created this offer
85              
86             =back
87              
88             =head1 AVAILABLE OPERATIONS
89              
90             =over 4
91              
92             =item delete
93              
94             L<Paymill::REST::Operations::Delete>
95              
96             =back
97              
98             =head1 SEE ALSO
99              
100             L<Paymill::REST> for more documentation.
101              
102             =head1 AUTHOR
103              
104             Matthias Dietrich E<lt>perl@rainboxx.deE<gt>
105              
106             =head1 COPYRIGHT
107              
108             Copyright 2013 - Matthias Dietrich
109              
110             =head1 LICENSE
111              
112             This library is free software; you can redistribute it and/or modify
113             it under the same terms as Perl itself.