summaryrefslogtreecommitdiffstats
path: root/lib/WWW/YNAB/Account.pm
blob: 3b61b9e9601193d9f03bb60cde4077a37508661a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
package WWW::YNAB::Account;

use Moose;
# ABSTRACT: Account model object

use Moose::Util::TypeConstraints qw(enum);

with 'WWW::YNAB::ModelHelpers';

=head1 SYNOPSIS

  use WWW::YNAB;

  my $ynab = WWW::YNAB->new(...);
  my @budgets = $ynab->budgets;
  my $account = $budgets[0]->account('12345678-1234-1234-1234-1234567890ab');

=head1 OVERVIEW

See L<https://api.youneedabudget.com/v1#/Accounts> for more information.

=cut

=method id

=cut

has id => (
    is       => 'ro',
    isa      => 'Str',
    required => 1,
);

=method name

=cut

has name => (
    is  => 'ro',
    isa => 'Str',
);

=method type

=cut

has type => (
    is  => 'ro',
    isa => enum([
        qw(checking savings cash creditCard lineOfCredit
           otherAsset otherLiability payPal merchantAccount
           investmentAccount mortgage)
    ]),
);

=method on_budget

=cut

has on_budget => (
    is  => 'ro',
    isa => 'Bool',
);

=method closed

=cut

has closed => (
    is  => 'ro',
    isa => 'Bool',
);

=method note

=cut

has note => (
    is  => 'ro',
    isa => 'Maybe[Str]',
);

=method balance

=cut

has balance => (
    is  => 'ro',
    isa => 'Int',
);

=method cleared_balance

=cut

has cleared_balance => (
    is  => 'ro',
    isa => 'Int',
);

=method uncleared_balance

=cut

has uncleared_balance => (
    is  => 'ro',
    isa => 'Int',
);

=method deleted

=cut

has deleted => (
    is  => 'ro',
    isa => 'Bool',
);

__PACKAGE__->meta->make_immutable;
no Moose;

1;