Twilio/Rest/Verify/V2/Service/Entity/NewFactor.pm

filter: Statementstmt 100% 48 / 48 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 24 / 24 Podpod n/a totaltotal 97.3% 73 / 75 CC 2 SCAR 0.8
CC
2
Cov
98%
create
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Twilio/Rest/Conversations/V1/Service/ConversationWithParticipants.pm ↑ Summary Twilio/Rest/Notify/V1/Service/Notification.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Verify::V2::Service::Entity::NewFactor;
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::Verify::V2::Service::Entity::NewFactorList;
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 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 1 my ($class, $version, $service_sid, $identity) = @_;
17 1 my $self = $class->SUPER::new($version);
18 1 $self->{solution} = { service_sid => $service_sid, identity => $identity };
19 1 $self->{uri} = join q{}, '/Services/', Twilio::Serialize::path_segment($service_sid),
20 '/Entities/', Twilio::Serialize::path_segment($identity), '/Factors';
21 1 return $self;
22 }
23  
24 1 ▶sub create {
Subroutine create: called CC=2 SCAR=7.0
25 1 my ($self, $friendly_name, $factor_type, $options) = @_;
26 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
27  
28 my $data = {
29 FriendlyName => $friendly_name,
30 FactorType => $factor_type,
31 'Binding.Alg' => $options->{binding_alg},
32 'Binding.PublicKey' => $options->{binding_public_key},
33 'Binding.Secret' => $options->{binding_secret},
34 'Config.Alg' => $options->{config_alg},
35 'Config.AppId' => $options->{config_app_id},
36 'Config.CodeLength' => $options->{config_code_length},
37 'Config.NotificationPlatform' => $options->{config_notification_platform},
38 'Config.NotificationToken' => $options->{config_notification_token},
39 'Config.SdkVersion' => $options->{config_sdk_version},
40 'Config.Skew' => $options->{config_skew},
41 'Config.TimeStep' => $options->{config_time_step},
42 1 Metadata => Twilio::Serialize::json_object($options->{metadata}),
43 };
44  
45 my $response =
46 1 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
47 return Twilio::Rest::Verify::V2::Service::Entity::NewFactorInstance->new(
48 $self->{version}, $response->get_content,
49 $self->{solution}{service_sid},
50 $self->{solution}{identity}
51 1 );
52 }
53  
54 package Twilio::Rest::Verify::V2::Service::Entity::NewFactorInstance;
55  
56 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
57  
58 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
59  
60 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
61 1 my ($class, $version, $payload, $service_sid, $identity) = @_;
62 1 my $self = $class->SUPER::new($version, $payload);
63 1 $self->{solution} = { service_sid => $service_sid, identity => $identity };
64 1 return $self;
65 }
66  
67 1 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
68 1 ▶sub binding { return $_[0]{properties}{binding} }
Subroutine binding: called CC=1 SCAR=0.0
69 1 ▶sub config { return $_[0]{properties}{config} }
Subroutine config: called CC=1 SCAR=0.0
70 1 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
71 1 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
72 1 ▶sub entity_sid { return $_[0]{properties}{entity_sid} }
Subroutine entity_sid: called CC=1 SCAR=0.0
73 1 ▶sub factor_type { return $_[0]{properties}{factor_type} }
Subroutine factor_type: called CC=1 SCAR=0.0
74 1 ▶sub friendly_name { return $_[0]{properties}{friendly_name} }
Subroutine friendly_name: called CC=1 SCAR=0.0
75 1 ▶sub identity { return $_[0]{properties}{identity} }
Subroutine identity: called CC=1 SCAR=0.0
76 1 ▶sub metadata { return $_[0]{properties}{metadata} }
Subroutine metadata: called CC=1 SCAR=0.0
77 1 ▶sub options { return $_[0]{properties}{options} }
Subroutine options: called CC=1 SCAR=0.0
78 1 ▶sub service_sid { return $_[0]{properties}{service_sid} }
Subroutine service_sid: called CC=1 SCAR=0.0
79 1 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
80 1 ▶sub status { return $_[0]{properties}{status} }
Subroutine status: called CC=1 SCAR=0.0
81 1 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
82  
83 2 1;
84  
85 __END__
« Twilio/Rest/Conversations/V1/Service/ConversationWithParticipants.pm ↑ Summary Twilio/Rest/Notify/V1/Service/Notification.pm »