lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/Subaccount/Cmd/Delete.pm

filter: Statementstmt 100% 22 / 22 Branchbran 50.0% 3 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 88.2% 30 / 34 CC 4 SCAR 9.5
CC
4
Cov
89%
execute
4.2
BEGIN
1.0
BEGIN
1.0
CRAP 2.6
« lib/WWW/Hetzner/CLI/Cmd/Sshkey/Cmd/Describe.pm ↑ Summary lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/Subaccount/Cmd/ChangeHomeDirectory.pm »
1 package WWW::Hetzner::CLI::Cmd::StorageBox::Cmd::Subaccount::Cmd::Delete;
2 # ABSTRACT: Delete a Storage Box subaccount
3  
4 1 our $VERSION = '0.102';
5  
6 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use MooX::Cmd;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use MooX::Options protect_argv => 0, usage_string => 'USAGE: hcloud.pl storage-box subaccount delete <storage-box> <subaccount>';
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use WWW::Hetzner::Storage::API::Subaccounts;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 with 'WWW::Hetzner::CLI::Role::WaitsForAction';
11  
12  
13 1 ▶sub execute {
Subroutine execute: called CC=4 SCAR=14.3
Pod undocumented
14 1 my ($self, $args, $chain) = @_;
15 1 ▶ my $id = $args->[0] or die "Usage: hcloud.pl storage-box subaccount delete <storage-box> <subaccount>\n";
Branch: 1 branch
BranchTrueFalseTotal
my $id = $args->[0] or die "Usage: hcloud.pl storage-box subaccount delete <storage-box> <subaccount>\n" 1 0 1
16 1 ▶ my $sub = $args->[1] or die "Usage: hcloud.pl storage-box subaccount delete <storage-box> <subaccount>\n";
Branch: 1 branch
BranchTrueFalseTotal
my $sub = $args->[1] or die "Usage: hcloud.pl storage-box subaccount delete <storage-box> <subaccount>\n" 1 0 1
17  
18 1 my $subaccounts = WWW::Hetzner::Storage::API::Subaccounts->new(
19 client => $chain->[0]->storage,
20 storage_box_id => $id,
21 );
22 1 my $action = $subaccounts->delete($sub);
23 1 $self->handle_action($action);
24 1 ▶ print $self->no_wait ? "Subaccount deletion requested.\n" : "Subaccount deleted.\n";
Branch: 1 branch
BranchTrueFalseTotal
$self->no_wait ? : 0 1 1
25 }
26  
27 1 1;
28  
29 __END__
« lib/WWW/Hetzner/CLI/Cmd/Sshkey/Cmd/Describe.pm ↑ Summary lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/Subaccount/Cmd/ChangeHomeDirectory.pm »