« Mattermost/V4/API/Object/Compliance/Report.pm
↑ Summary
Mattermost/V4/API/Object/Channel/Member.pm »
| 1 | package WebService::Mattermost::V4::API::Object::Job; | ||
| 2 | |||
| 3 | # ABSTRACT: A job item. | ||
| 4 | |||
| 5 | 12 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 12 | ▶ | use Types::Standard qw(HashRef Int Maybe Object Str); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 12 | extends 'WebService::Mattermost::V4::API::Object'; | |
| 9 | 12 | with qw( | |
| 10 | WebService::Mattermost::V4::API::Object::Role::APIMethods | ||
| 11 | WebService::Mattermost::V4::API::Object::Role::ID | ||
| 12 | WebService::Mattermost::V4::API::Object::Role::CreatedAt | ||
| 13 | WebService::Mattermost::V4::API::Object::Role::Status | ||
| 14 | ); | ||
| 15 | |||
| 16 | ################################################################################ | ||
| 17 | |||
| 18 | 12 | has type => (is => 'ro', isa => Maybe[Str], lazy => 1, builder => 1); | |
| 19 | 12 | has start_at => (is => 'ro', isa => Maybe[Int], lazy => 1, builder => 1); | |
| 20 | 12 | has last_activity_at => (is => 'ro', isa => Maybe[Int], lazy => 1, builder => 1); | |
| 21 | 12 | has progress => (is => 'ro', isa => Maybe[Int], lazy => 1, builder => 1); | |
| 22 | 12 | has data => (is => 'ro', isa => Maybe[HashRef], lazy => 1, builder => 1); | |
| 23 | 12 | has started_at => (is => 'ro', isa => Maybe[Object], lazy => 1, builder => 1); | |
| 24 | |||
| 25 | ################################################################################ | ||
| 26 | |||
| 27 | sub BUILD { | ||
| 28 | 0 | ▶ | my $self = shift; |
|
Subroutine
BUILD: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 29 | |||
| 30 | 0 | $self->api_resource_name('job'); | |
| 31 | 0 | $self->set_available_api_methods([ 'cancel' ]); | |
| 32 | |||
| 33 | 0 | return 1; | |
| 34 | } | ||
| 35 | |||
| 36 | ################################################################################ | ||
| 37 | |||
| 38 | sub _build_type { | ||
| 39 | 0 | ▶ | my $self = shift; |
|
Subroutine
_build_type: not called CC=1 SCAR=6.9
| |||
| 40 | |||
| 41 | 0 | return $self->raw_data->{type}; | |
| 42 | } | ||
| 43 | |||
| 44 | sub _build_start_at { | ||
| 45 | 0 | ▶ | my $self = shift; |
|
Subroutine
_build_start_at: not called CC=1 SCAR=6.9
| |||
| 46 | |||
| 47 | 0 | return $self->raw_data->{start_at}; | |
| 48 | } | ||
| 49 | |||
| 50 | sub _build_last_activity_at { | ||
| 51 | 0 | ▶ | my $self = shift; |
|
Subroutine
_build_last_activity_at: not called CC=1 SCAR=6.9
| |||
| 52 | |||
| 53 | 0 | return $self->raw_data->{last_activity_at}; | |
| 54 | } | ||
| 55 | |||
| 56 | sub _build_progress { | ||
| 57 | 0 | ▶ | my $self = shift; |
|
Subroutine
_build_progress: not called CC=1 SCAR=6.9
| |||
| 58 | |||
| 59 | 0 | return $self->raw_data->{progress}; | |
| 60 | } | ||
| 61 | |||
| 62 | sub _build_data { | ||
| 63 | 0 | ▶ | my $self = shift; |
|
Subroutine
_build_data: not called CC=1 SCAR=6.9
| |||
| 64 | |||
| 65 | 0 | return $self->raw_data->{data}; | |
| 66 | } | ||
| 67 | |||
| 68 | sub _build_started_at { | ||
| 69 | 0 | ▶ | my $self = shift; |
|
Subroutine
_build_started_at: not called CC=1 SCAR=6.9
| |||
| 70 | |||
| 71 | 0 | return $self->_from_epoch($self->start_at); | |
| 72 | } | ||
| 73 | |||
| 74 | ################################################################################ | ||
| 75 | |||
| 76 | 12 | 1; | |
| 77 | |||
| 78 | __END__ | ||
| 79 | |||
| 80 | =pod | ||
| 81 | |||
| 82 | =encoding UTF-8 | ||
| 83 | |||
| 84 | =head1 NAME | ||
| 85 | |||
| 86 | WebService::Mattermost::V4::API::Object::Job - A job item. | ||
| 87 | |||
| 88 | =head1 VERSION | ||
| 89 | |||
| 90 | version 0.28 | ||
| 91 | |||
| 92 | =head1 DESCRIPTION | ||
| 93 | |||
| 94 | =head2 METHODS | ||
| 95 | |||
| 96 | See matching methods in L<WebService::Mattermost::V4::API::Resource::Job> | ||
| 97 | for full documentation. | ||
| 98 | |||
| 99 | ID parameters are not required: | ||
| 100 | |||
| 101 | my $response = $mattermost->api->job->get('ID-HERE')->item->cancel(); | ||
| 102 | |||
| 103 | Is the same as: | ||
| 104 | |||
| 105 | my $response = $mattermost->api->job->cancel('ID-HERE'); | ||
| 106 | |||
| 107 | =over 4 | ||
| 108 | |||
| 109 | =item C<cancel()> | ||
| 110 | |||
| 111 | =back | ||
| 112 | |||
| 113 | =head2 ATTRIBUTES | ||
| 114 | |||
| 115 | =over 4 | ||
| 116 | |||
| 117 | =item C<type> | ||
| 118 | |||
| 119 | =item C<start_at> | ||
| 120 | |||
| 121 | =item C<started_at> | ||
| 122 | |||
| 123 | DateTime. | ||
| 124 | |||
| 125 | =item C<last_activity_at> | ||
| 126 | |||
| 127 | =item C<progress> | ||
| 128 | |||
| 129 | =item C<data> | ||
| 130 | |||
| 131 | =back | ||
| 132 | |||
| 133 | =head1 SEE ALSO | ||
| 134 | |||
| 135 | =over 4 | ||
| 136 | |||
| 137 | =item L<WebService::Mattermost::V4::API::Object::Job> | ||
| 138 | |||
| 139 | =item L<WebService::Mattermost::V4::API::Object::Jobs> | ||
| 140 | |||
| 141 | =item L<WebService::Mattermost::V4::API::Object::Role::ID> | ||
| 142 | |||
| 143 | =item L<WebService::Mattermost::V4::API::Object::Role::CreatedAt> | ||
| 144 | |||
| 145 | =item L<WebService::Mattermost::V4::API::Object::Role::Status> | ||
| 146 | |||
| 147 | =back | ||
| 148 | |||
| 149 | =head1 AUTHOR | ||
| 150 | |||
| 151 | Mike Jones <mike@netsplit.org.uk> | ||
| 152 | |||
| 153 | =head1 COPYRIGHT AND LICENSE | ||
| 154 | |||
| 155 | This software is Copyright (c) 2020 by Mike Jones. | ||
| 156 | |||
| 157 | This is free software, licensed under: | ||
| 158 | |||
| 159 | The MIT (X11) License | ||
| 160 | |||
| 161 | =cut | ||