| 1 | package Imgur::API::Endpoint::Image; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use Mouse; | ||
| 5 | extends 'Imgur::API::Endpoint'; | ||
| 6 | |||
| 7 | sub get { | ||
| 8 | my ($this,%p) = @_; | ||
| 9 | |||
| 10 | return $this->dispatcher->request( | ||
| 11 | $this->path("3/image/%s",['image'],[],\%p), | ||
| 12 | 'get', | ||
| 13 | \%p | ||
| 14 | ); | ||
| 15 | } | ||
| 16 | |||
| 17 | sub upload { | ||
| 18 | my ($this,%p) = @_; | ||
| 19 | |||
| 20 | return $this->dispatcher->request( | ||
| 21 | $this->path("3/image",[],[],\%p), | ||
| 22 | 'post', | ||
| 23 | \%p | ||
| 24 | ); | ||
| 25 | } | ||
| 26 | |||
| 27 | sub delete { | ||
| 28 | my ($this,%p) = @_; | ||
| 29 | |||
| 30 | return $this->dispatcher->request( | ||
| 31 | $this->path("3/image/%s",['image'],[],\%p), | ||
| 32 | 'delete', | ||
| 33 | \%p | ||
| 34 | ); | ||
| 35 | } | ||
| 36 | |||
| 37 | sub update { | ||
| 38 | my ($this,%p) = @_; | ||
| 39 | |||
| 40 | return $this->dispatcher->request( | ||
| 41 | $this->path("3/image/%s",['image'],[],\%p), | ||
| 42 | 'post', | ||
| 43 | \%p | ||
| 44 | ); | ||
| 45 | } | ||
| 46 | |||
| 47 | sub favorite { | ||
| 48 | my ($this,%p) = @_; | ||
| 49 | |||
| 50 | return $this->dispatcher->request( | ||
| 51 | $this->path("3/image/%s/favorite",['image'],[],\%p), | ||
| 52 | 'post', | ||
| 53 | \%p | ||
| 54 | ); | ||
| 55 | } | ||
| 56 | |||
| 57 | |||
| 58 | |||
| 59 | 1; | ||
| 60 | __PACKAGE__->meta->make_immutable; | ||
| 61 |