Twilio/Rest/Conversations/V1/Service/Configuration/Webhook.pm

filter: Statementstmt 88.2% 45 / 51 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 85.7% 18 / 21 Podpod n/a totaltotal 85.3% 64 / 75 CC 2 SCAR 2.1
CC
2
Cov
87%
update
2.0
fetch
2.0
update
2.0
CRAP 1.2
« Twilio/Rest/Conversations/V1/Service/Configuration/Notification.pm ↑ Summary Twilio/Rest/Bulkexports/V1/Export/ExportCustomJob.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Conversations::V1::Service::Configuration::Webhook;
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::Conversations::V1::Service::Configuration::WebhookContext;
10  
11 2 ▶use parent 'Twilio::InstanceContext';
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, $chat_service_sid) = @_;
17 2 my $self = $class->SUPER::new($version);
18 2 $self->{solution} = { chat_service_sid => $chat_service_sid };
19 2 $self->{uri} = join q{}, '/Services/', Twilio::Serialize::path_segment($chat_service_sid),
20 '/Configuration/Webhooks';
21 2 return $self;
22 }
23  
24 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
25 1 my ($self) = @_;
26  
27 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
28 1 return $self->_build_instance($response);
29 }
30  
31 1 ▶sub update {
Subroutine update: called CC=2 SCAR=7.0
32 1 my ($self, $options) = @_;
33 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
34  
35 my $data = {
36 Filters => $options->{filters},
37 Method => $options->{method},
38 PostWebhookUrl => $options->{post_webhook_url},
39 PreWebhookUrl => $options->{pre_webhook_url},
40 1 };
41  
42 my $response =
43 1 $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data });
44 1 return $self->_build_instance($response);
45 }
46  
47 2 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
48 2 my ($self, $response) = @_;
49 return Twilio::Rest::Conversations::V1::Service::Configuration::WebhookInstance->new(
50 2 $self->{version}, $response->get_content, $self->{solution}{chat_service_sid});
51 }
52  
53 package Twilio::Rest::Conversations::V1::Service::Configuration::WebhookInstance;
54  
55 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
56  
57 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
58  
59 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
60 2 my ($class, $version, $payload, $chat_service_sid) = @_;
61 2 my $self = $class->SUPER::new($version, $payload);
62 2 $self->{solution} = { chat_service_sid => $chat_service_sid };
63 2 return $self;
64 }
65  
66 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
67 0 my ($self, @arguments) = @_;
68 0 return $self->_context->fetch(@arguments);
69 }
70  
71 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
72 0 my ($self, @arguments) = @_;
73 0 return $self->_context->update(@arguments);
74 }
75  
76 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
77 0 my ($self) = @_;
78 return Twilio::Rest::Conversations::V1::Service::Configuration::WebhookContext->new(
79 0 $self->{version}, $self->{solution}{chat_service_sid});
80 }
81  
82 2 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
83 2 ▶sub chat_service_sid { return $_[0]{properties}{chat_service_sid} }
Subroutine chat_service_sid: called CC=1 SCAR=0.0
84 2 ▶sub filters { return $_[0]{properties}{filters} }
Subroutine filters: called CC=1 SCAR=0.0
85 2 ▶sub method { return $_[0]{properties}{method} }
Subroutine method: called CC=1 SCAR=0.0
86 2 ▶sub post_webhook_url { return $_[0]{properties}{post_webhook_url} }
Subroutine post_webhook_url: called CC=1 SCAR=0.0
87 2 ▶sub pre_webhook_url { return $_[0]{properties}{pre_webhook_url} }
Subroutine pre_webhook_url: called CC=1 SCAR=0.0
88 2 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
89  
90 2 1;
91  
92 __END__
« Twilio/Rest/Conversations/V1/Service/Configuration/Notification.pm ↑ Summary Twilio/Rest/Bulkexports/V1/Export/ExportCustomJob.pm »