| 1 | package Net::OAuth::AccessToken; | ||
| 2 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use base qw(Class::Accessor::Fast); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | __PACKAGE__->mk_accessors(qw/client token token_secret session_handle expires_in authorization_expires_in/); | |
| 6 | |||
| 7 | 3 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||
| 8 | 3 | my $class = shift; | |
| 9 | 3 | my %opts = @_; | |
| 10 | 3 | my $self = bless \%opts, $class; | |
| 11 | 3 | return $self; | |
| 12 | } | ||
| 13 | |||
| 14 | 0 | ▶ | sub request { |
|
Subroutine
request: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 15 | 0 | my $self = shift; | |
| 16 | 0 | my ($method, $uri, $header, $content, %params) = @_; | |
| 17 | 0 | my $oauth_req = $self->client->_make_request( | |
| 18 | 'protected resource', | ||
| 19 | request_method => $method, | ||
| 20 | request_url => $self->client->site_url($uri), | ||
| 21 | token => $self->token, | ||
| 22 | token_secret => $self->token_secret, | ||
| 23 | %params, | ||
| 24 | ); | ||
| 25 | 0 | $oauth_req->sign; | |
| 26 | |||
| 27 | 0 | return $self->client->request(HTTP::Request->new( | |
| 28 | $method => $oauth_req->to_url, $header, $content | ||
| 29 | )); | ||
| 30 | } | ||
| 31 | |||
| 32 | 0 | ▶ | sub get { |
|
Subroutine
get: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 33 | 0 | return shift->request('GET', @_); | |
| 34 | } | ||
| 35 | |||
| 36 | 0 | ▶ | sub post { |
|
Subroutine
post: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 37 | 0 | return shift->request('POST', @_); | |
| 38 | } | ||
| 39 | |||
| 40 | 0 | ▶ | sub delete { |
|
Subroutine
delete: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 41 | 0 | return shift->request('DELETE', @_); | |
| 42 | } | ||
| 43 | |||
| 44 | 0 | ▶ | sub put { |
|
Subroutine
put: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 45 | 0 | return shift->request('PUT', @_); | |
| 46 | } | ||
| 47 | |||
| 48 | =head1 NAME | ||
| 49 | |||
| 50 | Net::OAuth::AccessToken - OAuth Access Token | ||
| 51 | |||
| 52 | =head1 DESCRIPTION | ||
| 53 | |||
| 54 | WARNING: Net::OAuth::AccessToken is alpha code. The rest of Net::OAuth is quite | ||
| 55 | stable but this particular module is new, and is under-documented and under-tested. | ||
| 56 | |||
| 57 | =head1 SEE ALSO | ||
| 58 | |||
| 59 | L<Net::OAuth> | ||
| 60 | |||
| 61 | =head1 AUTHOR | ||
| 62 | |||
| 63 | Originally by Keith Grennan <foss@nearlyfree.org> | ||
| 64 | |||
| 65 | Currently maintained by Robert Rothenberg <perl@rhizomnic.com> | ||
| 66 | |||
| 67 | =head1 LICENSE AND COPYRIGHT | ||
| 68 | |||
| 69 | Copyright 2007-2012, 2024-2026 Keith Grennan | ||
| 70 | |||
| 71 | This program is free software; you can redistribute it and/or modify it | ||
| 72 | under the terms of either: the GNU General Public License as published | ||
| 73 | by the Free Software Foundation; or the Artistic License. | ||
| 74 | |||
| 75 | See http://dev.perl.org/licenses/ for more information. | ||
| 76 | |||
| 77 | =cut | ||
| 78 | |||
| 79 | |||
| 80 | 1 | 1; | |