« blib/lib/SignalWire/REST/Namespaces/Compat.pm
↑ Summary
blib/lib/SignalWire/REST/Namespaces/Resources.pm »
| 1 | package SignalWire::REST::Namespaces::Registry; | ||||||||||
| 2 | 6 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 6 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 6 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | # --- RegistryBrands --- | ||||||||||
| 7 | package SignalWire::REST::Namespaces::Registry::Brands; | ||||||||||
| 8 | 6 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 6 | extends 'SignalWire::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
| |||||||||||
| 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
| |||||||||||
| 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::REST::Namespaces::Registry::Campaigns; | ||||||||||
| 40 | 6 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 41 | 6 | extends 'SignalWire::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
| |||||||||||
| 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
| |||||||||||
| 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::REST::Namespaces::Registry::Orders; | ||||||||||
| 72 | 6 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 73 | 6 | extends 'SignalWire::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::REST::Namespaces::Registry::Numbers; | ||||||||||
| 82 | 6 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 83 | 6 | extends 'SignalWire::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 | # Python parity alias. | ||||||||||
| 91 | 0 | ▶ | sub delete { | ||||||||
|
Subroutine
delete: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 92 | 0 | my ($self, $number_id) = @_; | |||||||||
| 93 | 0 | return $self->_http->delete_request($self->_path($number_id)); | |||||||||
| 94 | } | ||||||||||
| 95 | |||||||||||
| 96 | # --- RegistryNamespace --- | ||||||||||
| 97 | package SignalWire::REST::Namespaces::Registry; | ||||||||||
| 98 | 6 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 99 | |||||||||||
| 100 | 6 | has '_http' => ( is => 'ro', required => 1 ); | |||||||||
| 101 | 6 | has 'brands' => ( is => 'lazy' ); | |||||||||
| 102 | 6 | has 'campaigns' => ( is => 'lazy' ); | |||||||||
| 103 | 6 | has 'orders' => ( is => 'lazy' ); | |||||||||
| 104 | 6 | has 'numbers' => ( is => 'lazy' ); | |||||||||
| 105 | |||||||||||
| 106 | 6 | my $base = '/api/relay/rest/registry/beta'; | |||||||||
| 107 | |||||||||||
| 108 | 2 | ▶ | sub _build_brands { SignalWire::REST::Namespaces::Registry::Brands->new(_http => $_[0]->_http, _base_path => "$base/brands") } | ||||||||
|
Subroutine
_build_brands: called CC=1 SCAR=0.0
| |||||||||||
| 109 | 2 | ▶ | sub _build_campaigns { SignalWire::REST::Namespaces::Registry::Campaigns->new(_http => $_[0]->_http, _base_path => "$base/campaigns") } | ||||||||
|
Subroutine
_build_campaigns: called CC=1 SCAR=0.0
| |||||||||||
| 110 | 1 | ▶ | sub _build_orders { SignalWire::REST::Namespaces::Registry::Orders->new(_http => $_[0]->_http, _base_path => "$base/orders") } | ||||||||
|
Subroutine
_build_orders: called CC=1 SCAR=0.0
| |||||||||||
| 111 | 1 | ▶ | sub _build_numbers { SignalWire::REST::Namespaces::Registry::Numbers->new(_http => $_[0]->_http, _base_path => "$base/numbers") } | ||||||||
|
Subroutine
_build_numbers: called CC=1 SCAR=0.0
| |||||||||||
| 112 | |||||||||||
| 113 | 6 | 1; | |||||||||