line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
# ABSTRACT: REG.API v2 user folders management |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
use strict; |
5
|
1
|
|
|
1
|
|
504
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
6
|
1
|
|
|
1
|
|
4
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
7
|
1
|
|
|
1
|
|
5
|
use namespace::autoclean; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
8
|
1
|
|
|
1
|
|
2195
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
8
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.052'; # VERSION |
10
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:CHIM'; # AUTHORITY |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with 'Regru::API::Role::Client'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has '+namespace' => ( |
15
|
|
|
|
|
|
|
default => sub { 'folder' }, |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
nop |
19
|
1
|
|
|
1
|
|
4
|
create |
20
|
|
|
|
|
|
|
remove |
21
|
|
|
|
|
|
|
rename |
22
|
|
|
|
|
|
|
get_services |
23
|
|
|
|
|
|
|
add_services |
24
|
|
|
|
|
|
|
remove_services |
25
|
|
|
|
|
|
|
replace_services |
26
|
|
|
|
|
|
|
move_services |
27
|
|
|
|
|
|
|
)]} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__PACKAGE__->namespace_methods; |
30
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; # End of Regru::API::Folder |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=pod |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=encoding UTF-8 |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 NAME |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Regru::API::Folder - REG.API v2 user folders management |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 VERSION |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
version 0.052 |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 DESCRIPTION |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
REG.API folders management methods such as create/remove/rename folders, get/put services linked to and others. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head2 namespace |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Always returns the name of category: C<folder>. For internal uses only. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 REG.API METHODS |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head2 nop |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
For testing purposes. Scope: B<everyone>. Typical usage: |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
$resp = $client->folder->nop( |
64
|
|
|
|
|
|
|
folder_name => 'our_folder', |
65
|
|
|
|
|
|
|
); |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Returns success response. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
More info at L<Folder management: nop|https://www.reg.com/support/help/api2#folder_nop>. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head2 create |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Creates a folder. Scope: B<clients>. Typical usage: |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
$resp = $client->folder->create( |
76
|
|
|
|
|
|
|
folder_name => 'vehicles', |
77
|
|
|
|
|
|
|
); |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Returns success response if folder was created or error otherwise. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
More info at L<Folder management: create|https://www.reg.com/support/help/api2#folder_create>. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head2 remove |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Deletes an existing folder. Scope: B<clients>. Typical usage: |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
$resp = $client->folder->remove( |
88
|
|
|
|
|
|
|
folder_id => 674908, |
89
|
|
|
|
|
|
|
); |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Returns success response if folder was deleted or error otherwise. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
More info at L<Folder management: remove|https://www.reg.com/support/help/api2#folder_remove>. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head2 rename |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
Renames an existing forder. Scope: B<clients>. Typical usage: |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
$resp = $client->folder->rename( |
100
|
|
|
|
|
|
|
folder_name => 'stuff', |
101
|
|
|
|
|
|
|
new_folder_name => 'items', |
102
|
|
|
|
|
|
|
); |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Returns success response if folder was renamed or error otherwise. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
More info at L<Folder management: rename|https://www.reg.com/support/help/api2#folder_rename>. |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head2 get_services |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Gets services linked to folder. Scope: B<clients>. Typical usage: |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
$resp = $client->folder->get_services( |
113
|
|
|
|
|
|
|
folder_id => 389765, |
114
|
|
|
|
|
|
|
); |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
A success answer will contains a C<folder_content> with a list of services (domain names, hosting related items, etc) linked |
117
|
|
|
|
|
|
|
to requested folder. |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
More info at L<Folder management: get_services|https://www.reg.com/support/help/api2#folder_get_services>. |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=head2 add_services |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
"Puts" services to folder. Scope: B<clients>. Typical usage: |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
$resp = $client->folder->add_services( |
126
|
|
|
|
|
|
|
folder_name => 'vehicles', |
127
|
|
|
|
|
|
|
services => [ |
128
|
|
|
|
|
|
|
{ domain_name => 'crucible.co.uk' }, |
129
|
|
|
|
|
|
|
{ domain_name => 'ss-madame-de-pompadour.ru' }, |
130
|
|
|
|
|
|
|
], |
131
|
|
|
|
|
|
|
return_folder_contents => 1, |
132
|
|
|
|
|
|
|
); |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
A successful answer will contains a C<services> field with a list of services that was linked to the specified folder |
135
|
|
|
|
|
|
|
and result for each of them. Additionally might be returned a C<folder_content> field. |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
More info at L<Folder management: add_services|https://www.reg.com/support/help/api2#folder_add_services>. |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=head2 remove_services |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
"Deletes" services from folder. Scope: B<clients>. Typical usage: |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
$resp = $client->folder->remove_services( |
144
|
|
|
|
|
|
|
folder_name => 'vehicles', |
145
|
|
|
|
|
|
|
services => [ |
146
|
|
|
|
|
|
|
{ domain_name => 'bow-tie.com' }, |
147
|
|
|
|
|
|
|
], |
148
|
|
|
|
|
|
|
); |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
A successful answer will contains a C<services> field with a list of services that was unlinked to the specified folder |
151
|
|
|
|
|
|
|
and result for each of them. Additionally might be returned a C<folder_content> field. |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
More info at L<Folder management: remove_services|https://www.reg.com/support/help/api2#folder_remove_services>. |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=head2 replace_services |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
"Replaces" services with a new set of services. Scope: B<clients>. Typical usage: |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
$resp = $client->folder->replace_services( |
160
|
|
|
|
|
|
|
folder_name => 'items', |
161
|
|
|
|
|
|
|
services => [ |
162
|
|
|
|
|
|
|
{ domain_name => 'bow-tie.com' }, |
163
|
|
|
|
|
|
|
{ service_id => 188650 }, |
164
|
|
|
|
|
|
|
{ service_id => 239076 }, |
165
|
|
|
|
|
|
|
], |
166
|
|
|
|
|
|
|
); |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
A successful answer will contains a C<services> field with a list of services that was linked to the specified folder |
169
|
|
|
|
|
|
|
and result for each of them. Additionally might be returned a C<folder_content> field. |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
More info at L<Folder management: replace_services|https://www.reg.com/support/help/api2#folder_replace_services>. |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=head2 move_services |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
"Transfers" services between folders. Scope: B<clients>. Typical usage: |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
$resp = $client->folder->move_services( |
178
|
|
|
|
|
|
|
folder_name => 'vehicles', |
179
|
|
|
|
|
|
|
new_folder_name => 'items', |
180
|
|
|
|
|
|
|
services => [ |
181
|
|
|
|
|
|
|
{ domain_name => 'bow-tie.cz' }, |
182
|
|
|
|
|
|
|
{ domain_name => 'hallucinogenic-lipstick.xxx' }, |
183
|
|
|
|
|
|
|
{ service_id => 783908 }, |
184
|
|
|
|
|
|
|
], |
185
|
|
|
|
|
|
|
); |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
A successful answer will contains a C<services> field with a list of services that was linked to the specified folder |
188
|
|
|
|
|
|
|
and result for each of them. Additionally might be returned a C<folder_content> field with a contents of a destination folder. |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
More info at L<Folder management: move_services|https://www.reg.com/support/help/api2#folder_move_services>. |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=head1 SEE ALSO |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
L<Regru::API> |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
L<Regru::API::Role::Client> |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
L<REG.API Folders management|https://www.reg.com/support/help/api2#folder_functions> |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
L<REG.API Common error codes|https://www.reg.com/support/help/api2#common_errors> |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
=head1 BUGS |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
Please report any bugs or feature requests on the bugtracker website |
205
|
|
|
|
|
|
|
L<https://github.com/regru/regru-api-perl/issues> |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
When submitting a bug or request, please include a test-file or a |
208
|
|
|
|
|
|
|
patch to an existing test-file that illustrates the bug or desired |
209
|
|
|
|
|
|
|
feature. |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
=head1 AUTHORS |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
=over 4 |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
=item * |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
Polina Shubina <shubina@reg.ru> |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
=item * |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
Anton Gerasimov <a.gerasimov@reg.ru> |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
=back |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
This software is copyright (c) 2013 by REG.RU LLC. |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
230
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
=cut |