Keys.pm

filter: Statementstmt 50.0% 10 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 37.5% 3 / 8 Podpod 100% 5 / 5 totaltotal 54.5% 18 / 33 CC 1 SCAR 4.9
CC
1
Cov
50%
ListKeys
2.0
GetKey
2.0
CreateKey
2.0
CRAP 1.6
« Phone.pm ↑ Summary Leads.pm »
1 package Tomba::Keys;
2  
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use parent 'Tomba::Client';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 =head1 NAME
8  
9 Tomba::Keys - API keys management for the Tomba.io API
10  
11 =head1 SYNOPSIS
12  
13 use Tomba::Keys;
14  
15 my $tomba = Tomba::Keys->new("ta_xxxxx", "ts_xxxxx");
16 my $keys = $tomba->ListKeys();
17  
18 =head1 DESCRIPTION
19  
20 Manage API keys for the Tomba account.
21  
22 =cut
23  
24 #-------------------------------------------------------------------------------
25 # API Keys Management
26 #-------------------------------------------------------------------------------
27  
28 =head2 ListKeys
29  
30 my $data = $tomba->ListKeys();
31  
32 Retrieve a list of API keys.
33  
34 See L<https://docs.tomba.io/api/keys#get-keys>
35  
36 =cut
37  
38 0 ▶sub ListKeys {
Subroutine ListKeys: not called CC=1 SCAR=6.9
Pod documented
39 0 my ($self) = @_;
40 0 return $self->call(Tomba::Client::KEYS_PATH);
41 }
42  
43 =head2 GetKey
44  
45 my $data = $tomba->GetKey($key_id);
46  
47 Retrieve details for a specific API key.
48  
49 See L<https://docs.tomba.io/api/keys#get-keys-keyid>
50  
51 =cut
52  
53 0 ▶sub GetKey {
Subroutine GetKey: not called CC=1 SCAR=6.9
Pod documented
54 0 my ($self, $key_id) = @_;
55 0 return $self->call(Tomba::Client::KEYS_PATH . "/$key_id");
56 }
57  
58 =head2 CreateKey
59  
60 my $data = $tomba->CreateKey();
61  
62 Create a new API key. The Free plan can create only one key.
63  
64 See L<https://docs.tomba.io/api/keys#post-keys>
65  
66 =cut
67  
68 0 ▶sub CreateKey {
Subroutine CreateKey: not called CC=1 SCAR=6.9
Pod documented
69 0 my ($self) = @_;
70 0 return $self->post(Tomba::Client::KEYS_PATH, {});
71 }
72  
73 =head2 ResetKey
74  
75 my $data = $tomba->ResetKey($key_id);
76  
77 Reset (regenerate) a specific API key.
78  
79 See L<https://docs.tomba.io/api/keys#put-keys-keyid>
80  
81 =cut
82  
83 0 ▶sub ResetKey {
Subroutine ResetKey: not called CC=1 SCAR=6.9
Pod documented
84 0 my ($self, $key_id) = @_;
85 0 return $self->put(Tomba::Client::KEYS_PATH . "/$key_id", {});
86 }
87  
88 =head2 DeleteKey
89  
90 my $data = $tomba->DeleteKey($key_id);
91  
92 Delete a specific API key.
93  
94 See L<https://docs.tomba.io/api/keys#delete-an-api-keys-keyid>
95  
96 =cut
97  
98 0 ▶sub DeleteKey {
Subroutine DeleteKey: not called CC=1 SCAR=6.9
Pod documented
99 0 my ($self, $key_id) = @_;
100 0 return $self->delete_request(Tomba::Client::KEYS_PATH . "/$key_id");
101 }
102  
103 4 1;
104 __END__
« Phone.pm ↑ Summary Leads.pm »