| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package WWW::Giraffi::API::Trigger; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 1 |  |  | 1 |  | 5 | use strict; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 44 |  | 
| 4 | 1 |  |  | 1 |  | 5 | use warnings; | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 26 |  | 
| 5 |  |  |  |  |  |  |  | 
| 6 | 1 |  |  | 1 |  | 5 | use parent qw(WWW::Giraffi::API::Request); | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 6 |  | 
| 7 |  |  |  |  |  |  |  | 
| 8 |  |  |  |  |  |  | our $VERSION = '0.2_04'; | 
| 9 |  |  |  |  |  |  |  | 
| 10 |  |  |  |  |  |  | sub all { | 
| 11 |  |  |  |  |  |  |  | 
| 12 | 0 |  |  | 0 | 1 |  | my ( $self, $other_options ) = @_; | 
| 13 | 0 |  |  |  |  |  | return $self->search(undef, $other_options); | 
| 14 |  |  |  |  |  |  | } | 
| 15 |  |  |  |  |  |  |  | 
| 16 |  |  |  |  |  |  | sub search { | 
| 17 |  |  |  |  |  |  |  | 
| 18 | 0 |  |  | 0 | 1 |  | my ( $self, $conditions, $other_options ) = @_; | 
| 19 | 0 |  |  |  |  |  | return $self->get( "triggers.json", $conditions, $other_options ); | 
| 20 |  |  |  |  |  |  | } | 
| 21 |  |  |  |  |  |  |  | 
| 22 |  |  |  |  |  |  | sub find { | 
| 23 |  |  |  |  |  |  |  | 
| 24 | 0 |  |  | 0 | 1 |  | my ( $self, $id, $other_options ) = @_; | 
| 25 | 0 |  |  |  |  |  | return $self->get( sprintf( "triggers/%s.json", $id ), undef, $other_options ); | 
| 26 |  |  |  |  |  |  | } | 
| 27 |  |  |  |  |  |  |  | 
| 28 |  |  |  |  |  |  | sub find_axion { | 
| 29 |  |  |  |  |  |  |  | 
| 30 | 0 |  |  | 0 | 1 |  | my ( $self, $id, $other_options ) = @_; | 
| 31 | 0 |  |  |  |  |  | return $self->get( sprintf( "triggers/%s/axions.json", $id ), undef, $other_options ); | 
| 32 |  |  |  |  |  |  | } | 
| 33 |  |  |  |  |  |  |  | 
| 34 |  |  |  |  |  |  | sub exec_axion { | 
| 35 |  |  |  |  |  |  |  | 
| 36 | 0 |  |  | 0 | 1 |  | my ( $self, $id, $other_options ) = @_; | 
| 37 | 0 |  |  |  |  |  | return $self->post( sprintf( "triggers/%s/axions/execute.json", $id ), undef, undef, $other_options ); | 
| 38 |  |  |  |  |  |  | } | 
| 39 |  |  |  |  |  |  |  | 
| 40 |  |  |  |  |  |  | sub update { | 
| 41 |  |  |  |  |  |  |  | 
| 42 | 0 |  |  | 0 | 1 |  | my ( $self, $id, $conditions, $other_options ) = @_; | 
| 43 | 0 |  |  |  |  |  | return $self->put( sprintf("triggers/%s.json", $id), undef, { trigger => $conditions }, $other_options ); | 
| 44 |  |  |  |  |  |  | } | 
| 45 |  |  |  |  |  |  |  | 
| 46 |  |  |  |  |  |  | sub update_axion { | 
| 47 |  |  |  |  |  |  |  | 
| 48 |  |  |  |  |  |  | # $axion_kind is problem or recovery | 
| 49 | 0 |  |  | 0 | 1 |  | my ( $self, $id, $axion_id, $axion_kind, $other_options ) = @_; | 
| 50 | 0 |  |  |  |  |  | return $self->put( sprintf("triggers/%s/axions/%s.json", $id, $axion_id), undef, { axionkind => $axion_kind }, $other_options ); | 
| 51 |  |  |  |  |  |  | } | 
| 52 |  |  |  |  |  |  |  | 
| 53 |  |  |  |  |  |  | sub destroy { | 
| 54 |  |  |  |  |  |  |  | 
| 55 | 0 |  |  | 0 | 1 |  | my ( $self, $id, $other_options ) = @_; | 
| 56 | 0 |  |  |  |  |  | return $self->delete( sprintf("triggers/%s.json", $id), undef, undef, $other_options ); | 
| 57 |  |  |  |  |  |  | } | 
| 58 |  |  |  |  |  |  |  | 
| 59 |  |  |  |  |  |  | sub remove_axion { | 
| 60 |  |  |  |  |  |  |  | 
| 61 | 0 |  |  | 0 | 1 |  | my ( $self, $id, $axion_id, $axion_kind, $other_options ) = @_; | 
| 62 | 0 |  |  |  |  |  | return $self->delete( sprintf("triggers/%s/axions/%s.json", $id, $axion_id ), undef, { axionkind => $axion_kind }, $other_options ); | 
| 63 |  |  |  |  |  |  | } | 
| 64 |  |  |  |  |  |  |  | 
| 65 |  |  |  |  |  |  | 1; | 
| 66 |  |  |  |  |  |  |  | 
| 67 |  |  |  |  |  |  | __END__ |