blib/lib/SignalWire/Agents/REST/Namespaces/Registry.pm

filter: Statementstmt 58.2% 39 / 67 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 12 / 24 Podpod 0.0% 0 / 12 totaltotal 45.9% 51 / 111 CC 5 SCAR 10.0
CC
5
Cov
52%
list
6.0
list_campaigns
6.0
list_numbers
6.0
CRAP 2.7
« blib/lib/SignalWire/Agents/REST/Namespaces/Resources.pm ↑ Summary blib/lib/SignalWire/Agents/REST/Namespaces/PhoneNumbers.pm »
1 package SignalWire::Agents::REST::Namespaces::Registry;
2 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 # --- RegistryBrands ---
7 package SignalWire::Agents::REST::Namespaces::Registry::Brands;
8 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 4 extends 'SignalWire::Agents::REST::Namespaces::Base';
10  
11 0 ▶sub list {
Subroutine list: not called CC=2 SCAR=17.9
Pod undocumented
12 0 my ($self, %params) = @_;
13 0 ▶ my $p = %params ? \%params : undef;
Branch: 1 branch
BranchTrueFalseTotal
%params ? : 0 0 0
14 0 return $self->_http->get($self->_base_path, params => $p);
15 }
16  
17 0 ▶sub create {
Subroutine create: not called CC=1 SCAR=6.9
Pod undocumented
18 0 my ($self, %kwargs) = @_;
19 0 return $self->_http->post($self->_base_path, body => \%kwargs);
20 }
21  
22 0 ▶sub get {
Subroutine get: not called CC=1 SCAR=6.9
Pod undocumented
23 0 my ($self, $brand_id) = @_;
24 0 return $self->_http->get($self->_path($brand_id));
25 }
26  
27 0 ▶sub list_campaigns {
Subroutine list_campaigns: not called CC=2 SCAR=17.9
Pod undocumented
28 0 my ($self, $brand_id, %params) = @_;
29 0 ▶ my $p = %params ? \%params : undef;
Branch: 1 branch
BranchTrueFalseTotal
%params ? : 0 0 0
30 0 return $self->_http->get($self->_path($brand_id, 'campaigns'), params => $p);
31 }
32  
33 0 ▶sub create_campaign {
Subroutine create_campaign: not called CC=1 SCAR=6.9
Pod undocumented
34 0 my ($self, $brand_id, %kwargs) = @_;
35 0 return $self->_http->post($self->_path($brand_id, 'campaigns'), body => \%kwargs);
36 }
37  
38 # --- RegistryCampaigns ---
39 package SignalWire::Agents::REST::Namespaces::Registry::Campaigns;
40 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
41 4 extends 'SignalWire::Agents::REST::Namespaces::Base';
42  
43 0 ▶sub get {
Subroutine get: not called CC=1 SCAR=6.9
Pod undocumented
44 0 my ($self, $campaign_id) = @_;
45 0 return $self->_http->get($self->_path($campaign_id));
46 }
47  
48 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
Pod undocumented
49 0 my ($self, $campaign_id, %kwargs) = @_;
50 0 return $self->_http->put($self->_path($campaign_id), body => \%kwargs);
51 }
52  
53 0 ▶sub list_numbers {
Subroutine list_numbers: not called CC=2 SCAR=17.9
Pod undocumented
54 0 my ($self, $campaign_id, %params) = @_;
55 0 ▶ my $p = %params ? \%params : undef;
Branch: 1 branch
BranchTrueFalseTotal
%params ? : 0 0 0
56 0 return $self->_http->get($self->_path($campaign_id, 'numbers'), params => $p);
57 }
58  
59 0 ▶sub list_orders {
Subroutine list_orders: not called CC=2 SCAR=17.9
Pod undocumented
60 0 my ($self, $campaign_id, %params) = @_;
61 0 ▶ my $p = %params ? \%params : undef;
Branch: 1 branch
BranchTrueFalseTotal
%params ? : 0 0 0
62 0 return $self->_http->get($self->_path($campaign_id, 'orders'), params => $p);
63 }
64  
65 0 ▶sub create_order {
Subroutine create_order: not called CC=1 SCAR=6.9
Pod undocumented
66 0 my ($self, $campaign_id, %kwargs) = @_;
67 0 return $self->_http->post($self->_path($campaign_id, 'orders'), body => \%kwargs);
68 }
69  
70 # --- RegistryOrders ---
71 package SignalWire::Agents::REST::Namespaces::Registry::Orders;
72 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
73 4 extends 'SignalWire::Agents::REST::Namespaces::Base';
74  
75 0 ▶sub get {
Subroutine get: not called CC=1 SCAR=6.9
Pod undocumented
76 0 my ($self, $order_id) = @_;
77 0 return $self->_http->get($self->_path($order_id));
78 }
79  
80 # --- RegistryNumbers ---
81 package SignalWire::Agents::REST::Namespaces::Registry::Numbers;
82 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
83 4 extends 'SignalWire::Agents::REST::Namespaces::Base';
84  
85 0 ▶sub delete_number {
Subroutine delete_number: not called CC=1 SCAR=6.9
Pod undocumented
86 0 my ($self, $number_id) = @_;
87 0 return $self->_http->delete_request($self->_path($number_id));
88 }
89  
90 # --- RegistryNamespace ---
91 package SignalWire::Agents::REST::Namespaces::Registry;
92 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
93  
94 4 has '_http' => ( is => 'ro', required => 1 );
95 4 has 'brands' => ( is => 'lazy' );
96 4 has 'campaigns' => ( is => 'lazy' );
97 4 has 'orders' => ( is => 'lazy' );
98 4 has 'numbers' => ( is => 'lazy' );
99  
100 4 my $base = '/api/relay/rest/registry/beta';
101  
102 2 ▶sub _build_brands { SignalWire::Agents::REST::Namespaces::Registry::Brands->new(_http => $_[0]->_http, _base_path => "$base/brands") }
Subroutine _build_brands: called CC=1 SCAR=0.0
103 2 ▶sub _build_campaigns { SignalWire::Agents::REST::Namespaces::Registry::Campaigns->new(_http => $_[0]->_http, _base_path => "$base/campaigns") }
Subroutine _build_campaigns: called CC=1 SCAR=0.0
104 1 ▶sub _build_orders { SignalWire::Agents::REST::Namespaces::Registry::Orders->new(_http => $_[0]->_http, _base_path => "$base/orders") }
Subroutine _build_orders: called CC=1 SCAR=0.0
105 1 ▶sub _build_numbers { SignalWire::Agents::REST::Namespaces::Registry::Numbers->new(_http => $_[0]->_http, _base_path => "$base/numbers") }
Subroutine _build_numbers: called CC=1 SCAR=0.0
106  
107 4 1;
« blib/lib/SignalWire/Agents/REST/Namespaces/Resources.pm ↑ Summary blib/lib/SignalWire/Agents/REST/Namespaces/PhoneNumbers.pm »