Twilio/Rest/IpMessaging/V2/Service/User/UserBinding.pm

filter: Statementstmt 85.0% 74 / 87 Branchbran n/a Conditioncond 60.0% 3 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 84.2% 32 / 38 Podpod n/a totaltotal 81.9% 109 / 133 CC 3 SCAR 2.2
CC
3
Cov
84%
page
2.0
new
2.0
read
2.0
CRAP 1.3
« Twilio/Rest/IpMessaging/V2/Service/Binding.pm ↑ Summary Twilio/Rest/Lookups/V2/LookupOverride.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::IpMessaging::V2::Service::User::UserBinding;
3  
4 2 ▶use 5.016;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 our $VERSION = '2.001';
8  
9 package Twilio::Rest::IpMessaging::V2::Service::User::UserBindingList;
10  
11 2 ▶use parent 'Twilio::ListResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 3 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 3 my ($class, $version, $service_sid, $user_sid) = @_;
17 3 my $self = $class->SUPER::new($version);
18 3 $self->{solution} = { service_sid => $service_sid, user_sid => $user_sid };
19 3 $self->{uri} = join q{}, '/Services/', Twilio::Serialize::path_segment($service_sid), '/Users/',
20 Twilio::Serialize::path_segment($user_sid), '/Bindings';
21 3 return $self;
22 }
23  
24 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
25 0 my ($self, @arguments) = @_;
26 0 return $self->read_records(@arguments);
27 }
28  
29 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
30 0 my ($self, @arguments) = @_;
31 0 return $self->stream_records(@arguments);
32 }
33  
34 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
35 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
36 1 ▶ $options //= {};
Condition50%1/2
$options //= {}
l!l
10
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
37  
38 my $params = {
39 BindingType => $options->{binding_type},
40 1 PageToken => $page_token,
41 Page => $page_number,
42 PageSize => $page_size,
43 };
44  
45 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
46 1 return $self->_build_page($response);
47 }
48  
49 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
50 0 my ($self, $target_url) = @_;
51 0 my $client = $self->{version}->get_domain->get_client;
52 0 return $self->_build_page($client->request('GET', $target_url));
53 }
54  
55 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
56 1 my ($self, $response) = @_;
57 return Twilio::Rest::IpMessaging::V2::Service::User::UserBindingPage->new($self->{version},
58 1 $response, $self->{solution});
59 }
60  
61 2 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
62 2 my ($self, $sid) = @_;
63 return Twilio::Rest::IpMessaging::V2::Service::User::UserBindingContext->new(
64 $self->{version},
65 $self->{solution}{service_sid},
66 2 $self->{solution}{user_sid}, $sid
67 );
68 }
69  
70 package Twilio::Rest::IpMessaging::V2::Service::User::UserBindingPage;
71  
72 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
73  
74 1 ▶sub records_key { return 'bindings' }
Subroutine records_key: called CC=1 SCAR=0.0
75  
76 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
77 1 my ($self, $payload) = @_;
78 return Twilio::Rest::IpMessaging::V2::Service::User::UserBindingInstance->new(
79 $self->{version}, $payload,
80 $self->{solution}{service_sid},
81 $self->{solution}{user_sid}
82 1 );
83 }
84  
85 package Twilio::Rest::IpMessaging::V2::Service::User::UserBindingContext;
86  
87 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
88  
89 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
90  
91 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
92 2 my ($class, $version, $service_sid, $user_sid, $sid) = @_;
93 2 my $self = $class->SUPER::new($version);
94 2 $self->{solution} = { service_sid => $service_sid, user_sid => $user_sid, sid => $sid };
95 2 $self->{uri} = join q{}, '/Services/', Twilio::Serialize::path_segment($service_sid), '/Users/',
96 Twilio::Serialize::path_segment($user_sid), '/Bindings/',
97 Twilio::Serialize::path_segment($sid);
98 2 return $self;
99 }
100  
101 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
102 1 my ($self) = @_;
103 1 $self->{version}->handle_request('DELETE', $self->{uri}, 'delete');
104 1 return 1;
105 }
106  
107 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
108 1 my ($self) = @_;
109  
110 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
111 1 return $self->_build_instance($response);
112 }
113  
114 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
115 1 my ($self, $response) = @_;
116 return Twilio::Rest::IpMessaging::V2::Service::User::UserBindingInstance->new(
117 $self->{version}, $response->get_content,
118 $self->{solution}{service_sid},
119 $self->{solution}{user_sid},
120 $self->{solution}{sid}
121 1 );
122 }
123  
124 package Twilio::Rest::IpMessaging::V2::Service::User::UserBindingInstance;
125  
126 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
127  
128 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
129  
130 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
131 2 my ($class, $version, $payload, $service_sid, $user_sid, $sid) = @_;
132 2 my $self = $class->SUPER::new($version, $payload);
133 $self->{solution} =
134 2 ▶ { service_sid => $service_sid, user_sid => $user_sid, sid => $sid // $self->{properties}{sid} };
Condition66%2/3
$sid // $self->{"properties"}{"sid"}
l!l&&r!l&&!r
110
MC/DC0%0/2
$sid // $self->{"properties"}{"sid"}
$sid $self->{"properties"}{"sid"}
Truth table66%2/3
A // B
A= $sidB= $self->{"properties"}{"sid"}
ABresult
1X1
011
000
135 2 return $self;
136 }
137  
138 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
139 0 my ($self, @arguments) = @_;
140 0 return $self->_context->delete(@arguments);
141 }
142  
143 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
144 0 my ($self, @arguments) = @_;
145 0 return $self->_context->fetch(@arguments);
146 }
147  
148 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
149 0 my ($self) = @_;
150 return Twilio::Rest::IpMessaging::V2::Service::User::UserBindingContext->new(
151 $self->{version},
152 $self->{solution}{service_sid},
153 $self->{solution}{user_sid},
154 $self->{solution}{sid}
155 0 );
156 }
157  
158 2 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
159 2 ▶sub binding_type { return $_[0]{properties}{binding_type} }
Subroutine binding_type: called CC=1 SCAR=0.0
160 2 ▶sub credential_sid { return $_[0]{properties}{credential_sid} }
Subroutine credential_sid: called CC=1 SCAR=0.0
161 2 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
162 2 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
163 2 ▶sub endpoint { return $_[0]{properties}{endpoint} }
Subroutine endpoint: called CC=1 SCAR=0.0
164 2 ▶sub identity { return $_[0]{properties}{identity} }
Subroutine identity: called CC=1 SCAR=0.0
165 2 ▶sub message_types { return $_[0]{properties}{message_types} }
Subroutine message_types: called CC=1 SCAR=0.0
166 2 ▶sub service_sid { return $_[0]{properties}{service_sid} }
Subroutine service_sid: called CC=1 SCAR=0.0
167 2 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
168 2 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
169 2 ▶sub user_sid { return $_[0]{properties}{user_sid} }
Subroutine user_sid: called CC=1 SCAR=0.0
170  
171 2 1;
172  
173 __END__
« Twilio/Rest/IpMessaging/V2/Service/Binding.pm ↑ Summary Twilio/Rest/Lookups/V2/LookupOverride.pm »