Twilio/Rest/Studio/V2/Flow/FlowRevision.pm

filter: Statementstmt 86.7% 72 / 83 Branchbran n/a Conditioncond 60.0% 3 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 86.4% 32 / 37 Podpod n/a totaltotal 83.5% 107 / 128 CC 3 SCAR 2.1
CC
3
Cov
85%
page
2.0
new
2.0
read
2.0
CRAP 1.2
« Twilio/Rest/Memory/V1/Import.pm ↑ Summary Twilio/Rest/Conversations/V2/Communication.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Studio::V2::Flow::FlowRevision;
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::Studio::V2::Flow::FlowRevisionList;
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 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 2 my ($class, $version, $sid) = @_;
17 2 my $self = $class->SUPER::new($version);
18 2 $self->{solution} = { sid => $sid };
19 2 $self->{uri} = join q{}, '/Flows/', Twilio::Serialize::path_segment($sid), '/Revisions';
20 2 return $self;
21 }
22  
23 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
24 0 my ($self, @arguments) = @_;
25 0 return $self->read_records(@arguments);
26 }
27  
28 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
29 0 my ($self, @arguments) = @_;
30 0 return $self->stream_records(@arguments);
31 }
32  
33 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
34 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
35 1 ▶ $options //= {};
Condition50%1/2
$options //= {}
l!l
01
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
36  
37 1 my $params = {
38 PageToken => $page_token,
39 Page => $page_number,
40 PageSize => $page_size,
41 };
42  
43 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
44 1 return $self->_build_page($response);
45 }
46  
47 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
48 0 my ($self, $target_url) = @_;
49 0 my $client = $self->{version}->get_domain->get_client;
50 0 return $self->_build_page($client->request('GET', $target_url));
51 }
52  
53 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
54 1 my ($self, $response) = @_;
55 return Twilio::Rest::Studio::V2::Flow::FlowRevisionPage->new($self->{version}, $response,
56 1 $self->{solution});
57 }
58  
59 1 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
60 1 my ($self, $revision) = @_;
61 return Twilio::Rest::Studio::V2::Flow::FlowRevisionContext->new($self->{version},
62 1 $self->{solution}{sid}, $revision);
63 }
64  
65 package Twilio::Rest::Studio::V2::Flow::FlowRevisionPage;
66  
67 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
68  
69 1 ▶sub records_key { return 'revisions' }
Subroutine records_key: called CC=1 SCAR=0.0
70  
71 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
72 1 my ($self, $payload) = @_;
73 return Twilio::Rest::Studio::V2::Flow::FlowRevisionInstance->new($self->{version}, $payload,
74 1 $self->{solution}{sid});
75 }
76  
77 package Twilio::Rest::Studio::V2::Flow::FlowRevisionContext;
78  
79 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
80  
81 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
82  
83 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
84 1 my ($class, $version, $sid, $revision) = @_;
85 1 my $self = $class->SUPER::new($version);
86 1 $self->{solution} = { sid => $sid, revision => $revision };
87 1 $self->{uri} = join q{}, '/Flows/', Twilio::Serialize::path_segment($sid), '/Revisions/',
88 Twilio::Serialize::path_segment($revision);
89 1 return $self;
90 }
91  
92 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
93 1 my ($self) = @_;
94  
95 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
96 1 return $self->_build_instance($response);
97 }
98  
99 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
100 1 my ($self, $response) = @_;
101 return Twilio::Rest::Studio::V2::Flow::FlowRevisionInstance->new(
102 $self->{version}, $response->get_content,
103 $self->{solution}{sid}, $self->{solution}{revision}
104 1 );
105 }
106  
107 package Twilio::Rest::Studio::V2::Flow::FlowRevisionInstance;
108  
109 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
110  
111 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
112  
113 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
114 2 my ($class, $version, $payload, $sid, $revision) = @_;
115 2 my $self = $class->SUPER::new($version, $payload);
116 2 ▶ $self->{solution} = { sid => $sid, revision => $revision // $self->{properties}{revision} };
Condition66%2/3
$revision // $self->{"properties"}{"revision"}
l!l&&r!l&&!r
110
MC/DC0%0/2
$revision // $self->{"properties"}{"revision"}
$revision $self->{"properties"}{"revision"}
Truth table66%2/3
A // B
A= $revisionB= $self->{"properties"}{"revision"}
ABresult
1X1
011
000
117 2 return $self;
118 }
119  
120 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
121 0 my ($self, @arguments) = @_;
122 0 return $self->_context->fetch(@arguments);
123 }
124  
125 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
126 0 my ($self) = @_;
127 return Twilio::Rest::Studio::V2::Flow::FlowRevisionContext->new(
128 $self->{version},
129 $self->{solution}{sid},
130 $self->{solution}{revision}
131 0 );
132 }
133  
134 2 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
135 2 ▶sub author_sid { return $_[0]{properties}{author_sid} }
Subroutine author_sid: called CC=1 SCAR=0.0
136 2 ▶sub commit_message { return $_[0]{properties}{commit_message} }
Subroutine commit_message: called CC=1 SCAR=0.0
137 2 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
138 2 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
139 2 ▶sub definition { return $_[0]{properties}{definition} }
Subroutine definition: called CC=1 SCAR=0.0
140 2 ▶sub errors { return $_[0]{properties}{errors} }
Subroutine errors: called CC=1 SCAR=0.0
141 2 ▶sub friendly_name { return $_[0]{properties}{friendly_name} }
Subroutine friendly_name: called CC=1 SCAR=0.0
142 2 ▶sub revision { return $_[0]{properties}{revision} }
Subroutine revision: called CC=1 SCAR=0.0
143 2 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
144 2 ▶sub status { return $_[0]{properties}{status} }
Subroutine status: called CC=1 SCAR=0.0
145 2 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
146 2 ▶sub valid { return $_[0]{properties}{valid} }
Subroutine valid: called CC=1 SCAR=0.0
147  
148 2 1;
149  
150 __END__
« Twilio/Rest/Memory/V1/Import.pm ↑ Summary Twilio/Rest/Conversations/V2/Communication.pm »