File Coverage

blib/lib/WebService/DS/SOP/Auth/V1_1/Request/DELETE.pm
Criterion Covered Total %
statement 20 20 100.0
branch 4 4 100.0
condition n/a
subroutine 6 6 100.0
pod 1 1 100.0
total 31 31 100.0


line stmt bran cond sub pod time code
1             package WebService::DS::SOP::Auth::V1_1::Request::DELETE;
2 3     3   787 use strict;
  3         11  
  3         88  
3 3     3   15 use warnings;
  3         7  
  3         69  
4 3     3   14 use Carp ();
  3         10  
  3         52  
5 3     3   1533 use HTTP::Request::Common qw(DELETE);
  3         57999  
  3         202  
6 3     3   932 use WebService::DS::SOP::Auth::V1_1::Util qw(create_signature);
  3         8  
  3         426  
7              
8             sub create_request {
9 4     4 1 16232 my ($class, $uri, $params, $app_secret) = @_;
10              
11 4 100       42 Carp::croak('Missing required parameter: time') if not $params->{time};
12 3 100       19 Carp::croak('Missing app_secret') if not $app_secret;
13              
14 2         12 $uri->query_form({
15             %$params,
16             sig => create_signature($params, $app_secret),
17             });
18 2         311 DELETE $uri;
19             }
20              
21             1;
22              
23             __END__
24              
25             =encoding utf-8
26              
27             =head1 NAME
28              
29             WebService::DS::SOP::Auth::V1_1::Request::DELETE
30              
31             =head1 DESCRIPTION
32              
33             To create a valid L<HTTP::Request> object for C<DELETE> request.
34              
35             =head1 FUNCTIONS
36              
37             =head2 $class->create_request( URI $uri, Hash $params, Str $app_secret ) returns HTTP::Request
38              
39             Returns L<HTTP::Request> object for a DELETE request.
40              
41             =head1 LICENSE
42              
43             Copyright (C) dataSpring, Inc.
44             Copyright (C) Research Panel Asia, Inc.
45              
46             This library is free software; you can redistribute it and/or modify
47             it under the same terms as Perl itself.
48              
49             =head1 AUTHOR
50              
51             yowcow E<lt>yoko.oyama [ at ] d8aspring.comE<gt>
52              
53             =cut
54