Twilio/Rest/Memory/V1/Import.pm

filter: Statementstmt 87.6% 85 / 97 Branchbran n/a Conditioncond 40.0% 2 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 85.3% 35 / 41 Podpod n/a totaltotal 83.5% 122 / 146 CC 3 SCAR 2.1
CC
3
Cov
85%
new
2.1
page
2.0
read
2.0
CRAP 1.2
« Twilio/Rest/Intelligence/V3/Conversation.pm ↑ Summary Twilio/Rest/Studio/V2/Flow/FlowRevision.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Memory::V1::Import;
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::Memory::V1::ImportList;
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, $store_id) = @_;
17 3 my $self = $class->SUPER::new($version);
18 3 $self->{solution} = { store_id => $store_id };
19 3 $self->{uri} = join q{}, '/Stores/', Twilio::Serialize::path_segment($store_id),
20 '/Profiles/Imports';
21 3 return $self;
22 }
23  
24 1 ▶sub create {
Subroutine create: called CC=1 SCAR=0.0
25 1 my ($self, $body) = @_;
26  
27 1 my $data = Twilio::Serialize::json_body($body, {});
28  
29 my $response = $self->{version}->handle_request(
30 'POST',
31 $self->{uri},
32 1 'create',
33 {
34 data => $data,
35 headers => { 'Content-Type' => 'application/json', }
36 }
37 );
38 return Twilio::Rest::Memory::V1::ProfileImportCreatedResponseInstance->new($self->{version},
39 1 $response->get_content);
40 }
41  
42 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
43 0 my ($self, @arguments) = @_;
44 0 return $self->read_records(@arguments);
45 }
46  
47 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
48 0 my ($self, @arguments) = @_;
49 0 return $self->stream_records(@arguments);
50 }
51  
52 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
53 1 my ($self, $options, $page_size, $page_token) = @_;
54 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
55  
56 my $params = {
57 orderBy => $options->{order_by},
58 1 pageSize => $page_size,
59 pageToken => $page_token,
60 };
61  
62 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
63 1 return $self->_build_page($response);
64 }
65  
66 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
67 0 my ($self, $target_url) = @_;
68 0 my $client = $self->{version}->get_domain->get_client;
69 0 return $self->_build_page($client->request('GET', $target_url));
70 }
71  
72 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
73 1 my ($self, $response) = @_;
74 1 return Twilio::Rest::Memory::V1::ImportPage->new($self->{version}, $response, $self->{solution});
75 }
76  
77 1 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
78 1 my ($self, $import_id) = @_;
79 return Twilio::Rest::Memory::V1::ImportContext->new($self->{version},
80 1 $self->{solution}{store_id}, $import_id);
81 }
82  
83 package Twilio::Rest::Memory::V1::ImportPage;
84  
85 2 ▶use parent 'Twilio::TokenPaginationPage';
Subroutine BEGIN: called CC=1 SCAR=0.0
86  
87 1 ▶sub records_key { return 'imports' }
Subroutine records_key: called CC=1 SCAR=0.0
88  
89 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
90 1 my ($self, $payload) = @_;
91 return Twilio::Rest::Memory::V1::ImportInstance->new($self->{version}, $payload,
92 1 $self->{solution}{store_id});
93 }
94  
95 package Twilio::Rest::Memory::V1::ImportContext;
96  
97 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
98  
99 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
100  
101 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
102 1 my ($class, $version, $store_id, $import_id) = @_;
103 1 my $self = $class->SUPER::new($version);
104 1 $self->{solution} = { store_id => $store_id, import_id => $import_id };
105 1 $self->{uri} = join q{}, '/Stores/', Twilio::Serialize::path_segment($store_id),
106 '/Profiles/Imports/', Twilio::Serialize::path_segment($import_id);
107 1 return $self;
108 }
109  
110 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
111 1 my ($self) = @_;
112  
113 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
114 return Twilio::Rest::Memory::V1::FetchProfileImportV2200ResponseInstance->new($self->{version},
115 1 $response->get_content);
116 }
117  
118 package Twilio::Rest::Memory::V1::ImportInstance;
119  
120 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
121  
122 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
123  
124 1 ▶sub new {
Subroutine new: called CC=2 SCAR=7.4
125 1 my ($class, $version, $payload, $store_id, $import_id) = @_;
126 1 my $self = $class->SUPER::new($version, $payload);
127 1 ▶ $self->{solution} = { store_id => $store_id, import_id => $import_id // $self->{properties}{id} };
Condition33%1/3
$import_id // $self->{"properties"}{"id"}
l!l&&r!l&&!r
001
MC/DC0%0/2
$import_id // $self->{"properties"}{"id"}
$import_id $self->{"properties"}{"id"}
Truth table33%1/3
A // B
A= $import_idB= $self->{"properties"}{"id"}
ABresult
1X1
011
000
128 1 return $self;
129 }
130  
131 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
132 0 my ($self, @arguments) = @_;
133 0 return $self->_context->fetch(@arguments);
134 }
135  
136 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
137 0 my ($self) = @_;
138 return Twilio::Rest::Memory::V1::ImportContext->new(
139 $self->{version},
140 $self->{solution}{store_id},
141 $self->{solution}{import_id}
142 0 );
143 }
144  
145 0 ▶sub id { return $_[0]{properties}{id} }
Subroutine id: not called CC=1 SCAR=6.9
146  
147 package Twilio::Rest::Memory::V1::ProfileImportCreatedResponseInstance;
148  
149 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
150  
151 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
152  
153 1 ▶sub created_at { return Twilio::Deserialize::date_time($_[0]{properties}{createdAt}) }
Subroutine created_at: called CC=1 SCAR=0.0
154 1 ▶sub import_id { return $_[0]{properties}{importId} }
Subroutine import_id: called CC=1 SCAR=0.0
155 1 ▶sub operation_id { return $_[0]{properties}{operationId} }
Subroutine operation_id: called CC=1 SCAR=0.0
156 1 ▶sub status_url { return $_[0]{properties}{statusUrl} }
Subroutine status_url: called CC=1 SCAR=0.0
157 1 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
158  
159 package Twilio::Rest::Memory::V1::FetchProfileImportV2200ResponseInstance;
160  
161 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
162  
163 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
164  
165 1 ▶sub column_mappings { return $_[0]{properties}{columnMappings} }
Subroutine column_mappings: called CC=1 SCAR=0.0
166 1 ▶sub created_at { return Twilio::Deserialize::date_time($_[0]{properties}{createdAt}) }
Subroutine created_at: called CC=1 SCAR=0.0
167 1 ▶sub file_size { return $_[0]{properties}{fileSize} }
Subroutine file_size: called CC=1 SCAR=0.0
168 1 ▶sub filename { return $_[0]{properties}{filename} }
Subroutine filename: called CC=1 SCAR=0.0
169 1 ▶sub status { return $_[0]{properties}{status} }
Subroutine status: called CC=1 SCAR=0.0
170 1 ▶sub summary { return $_[0]{properties}{summary} }
Subroutine summary: called CC=1 SCAR=0.0
171 1 ▶sub updated_at { return Twilio::Deserialize::date_time($_[0]{properties}{updatedAt}) }
Subroutine updated_at: called CC=1 SCAR=0.0
172  
173 2 1;
174  
175 __END__
« Twilio/Rest/Intelligence/V3/Conversation.pm ↑ Summary Twilio/Rest/Studio/V2/Flow/FlowRevision.pm »