Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Roman Lacko
gitlab_api
Commits
f4dba556
Commit
f4dba556
authored
Jan 08, 2018
by
Roman Lacko
Browse files
add Events API
parent
46c0f8a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
GitLab/Events.pm
0 → 100644
View file @
f4dba556
package
GitLab::
Events
;
use
utf8
;
use
strict
;
use
warnings
;
use
vars
qw($VERSION)
;
use
GitLab::
API
;
use
Log::
Any
qw($log)
;
our
$VERSION
=
v10
.3.3
;
my
$requests
=
{
self_events
=>
{
method
=>
"
GET
",
path
=>
"
/events
",
query
=>
[
qw(
action
target_type
before
after
sort
)
],
paginated
=>
1
,
},
user_events
=>
{
method
=>
"
GET
",
path
=>
"
/user/<uid>/events
",
query
=>
[
qw(
action
target_type
before
after
sort
)
],
paginated
=>
1
,
},
project_events
=>
{
method
=>
"
GET
",
path
=>
"
/projects/<id>/events
",
query
=>
[
qw(
action
target_type
before
after
sort
)
],
paginated
=>
1
,
},
};
sub
import
{
$log
->
debug
("
initializing
"
.
__PACKAGE__
);
while
(
my
(
$name
,
$tmpl
)
=
each
(
%$requests
))
{
$tmpl
->
{
name
}
=
$name
unless
exists
$tmpl
->
{
name
};
GitLab::
API
->
register
(
$tmpl
);
}
}
1
;
__END__
=head1 NAME
GitLab::Events - implements events API calls
See L<GitLab API -- Events|https://docs.gitlab.com/ce/api/events.html> for details and
response formats.
=head1 VERSION
Implements API calls for GitLab CE C<v10.3.3>.
=head1 DESCRIPTION
=over
=item L<self_events()|https://docs.gitlab.com/ce/api/events.html#list-currently-authenticated-user-39-s-events>
$events = $gitlab->self_events( [:action,] [:target_type,] ... );
Returns events associated with the authenticated user.
=item L<user_events()|https://docs.gitlab.com/ce/api/events.html#get-user-contribution-events>
$events = $gitlab->user_events( :uid, [:action,] [:target_type,] ... );
Returns contribution events for the given user.
=item L<project_events()|https://docs.gitlab.com/ce/api/events.html#list-a-project-39-s-visible-events>
$events = $gitlab->project_events( :uid, [:action,] [:target_type,] ... );
Returns events associated with the given project.
=back
=head1 AUTHOR
Roman Lacko <L<xlacko1@fi.muni.cz>>
=head1 SEE ALSO
=over
=item L<GitLab>
Wrapper around L<GitLab::API> and other C<GitLab::*> modules.
=back
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment