File Coverage

blib/lib/RT/Client/REST/Group.pm
Criterion Covered Total %
statement 23 26 88.4
branch n/a
condition n/a
subroutine 9 11 81.8
pod 1 1 100.0
total 33 38 86.8


line stmt bran cond sub pod time code
1             #!perl
2             # PODNAME: RT::Client::REST::Group
3             # ABSTRACT: group object representation.
4              
5 1     1   91074 use strict;
  1         10  
  1         24  
6 1     1   5 use warnings;
  1         1  
  1         40  
7              
8             $RT::Client::REST::Group::VERSION = '0.70';
9             use parent 'RT::Client::REST::Object';
10 1     1   369  
  1         249  
  1         4  
11             use Params::Validate qw(:types);
12 1     1   47 use RT::Client::REST;
  1         2  
  1         156  
13 1     1   506 use RT::Client::REST::Object::Exception;
  1         13  
  1         43  
14 1     1   6 use RT::Client::REST::SearchResult;
  1         2  
  1         11  
15 1     1   55  
  1         2  
  1         144  
16              
17             id => {
18             validation => {
19             type => SCALAR,
20             },
21             form2value => sub {
22             shift =~ m~^group/(\d+)$~i;
23             return $1;
24 0     0   0 },
25 0         0 value2form => sub {
26             return 'group/' . shift;
27             },
28 0     0   0 },
29              
30             name => {
31             validation => {
32 1     1   16 type => SCALAR,
33             },
34             },
35             description => {
36             validation => {
37             type => SCALAR,
38             },
39             },
40             members => {
41             validation => {
42             type => ARRAYREF,
43             },
44             list => 1,
45             },
46             disabled => {
47             validation => {
48             type => SCALAR,
49             },
50             },
51             }}
52              
53              
54              
55              
56 1     1 1 3867 __PACKAGE__->_generate_methods;
57              
58             1;
59              
60              
61             =pod
62              
63             =encoding UTF-8
64              
65             =head1 NAME
66              
67             RT::Client::REST::Group - group object representation.
68              
69             =head1 VERSION
70              
71             version 0.70
72              
73             =head1 SYNOPSIS
74              
75             my $rt = RT::Client::REST->new(server => $ENV{RTSERVER});
76              
77             my $group = RT::Client::REST::Group->new(
78             rt => $rt,
79             id => $id,
80             )->retrieve;
81              
82             =head1 DESCRIPTION
83              
84             B<RT::Client::REST::Group> is based on L<RT::Client::REST::Object>.
85             The representation allows one to retrieve, edit, and create groups in RT.
86              
87             Note: RT currently does not allow REST client to search groups.
88              
89             =head1 ATTRIBUTES
90              
91             =over 2
92              
93             =item B<id>
94              
95             For retrieval, you can specify either the numeric ID of the group or his
96             group name. After the retrieval, however, this attribute will be set
97             to the numeric id.
98              
99             =item B<name>
100              
101             Name of the group
102              
103             =item B<description>
104              
105             Description
106              
107             =item B<members>
108              
109             List of the members of this group.
110              
111             =back
112              
113             =head1 DB METHODS
114              
115             For full explanation of these, please see B<"DB METHODS"> in
116             L<RT::Client::REST::Object> documentation.
117              
118             =over 2
119              
120             =item B<retrieve>
121              
122             Retrieve RT group from database.
123              
124             =item B<store>
125              
126             Create or update the group.
127              
128             =item B<search>
129              
130             Currently RT does not allow REST clients to search groups.
131              
132             =back
133              
134             =head1 INTERNAL METHODS
135              
136             =over 2
137              
138             =item B<rt_type>
139              
140             Returns 'group'.
141              
142             =back
143              
144             =head1 SEE ALSO
145              
146             L<RT::Client::REST>, L<RT::Client::REST::Object>,
147             L<RT::Client::REST::SearchResult>.
148              
149             =head1 AUTHOR
150              
151             Dean Hamstead <dean@fragfest.com.au>
152              
153             =head1 COPYRIGHT AND LICENSE
154              
155             This software is copyright (c) 2022, 2020 by Dmitri Tikhonov.
156              
157             This is free software; you can redistribute it and/or modify it under
158             the same terms as the Perl 5 programming language system itself.
159              
160             =cut