LeadsAttributes.pm

filter: Statementstmt 50.0% 10 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 37.5% 3 / 8 Podpod 100% 5 / 5 totaltotal 54.5% 18 / 33 CC 1 SCAR 4.9
CC
1
Cov
50%
ListAttributes
2.0
GetAttribute
2.0
CreateAttribute
2.0
CRAP 1.6
« Leads.pm ↑ Summary LeadsList.pm »
1 package Tomba::LeadsAttributes;
2  
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use parent 'Tomba::Client';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 =head1 NAME
8  
9 Tomba::LeadsAttributes - Lead attributes management for the Tomba.io API
10  
11 =head1 SYNOPSIS
12  
13 use Tomba::LeadsAttributes;
14  
15 my $tomba = Tomba::LeadsAttributes->new("ta_xxxxx", "ts_xxxxx");
16 my $attrs = $tomba->ListAttributes();
17  
18 =head1 DESCRIPTION
19  
20 Create, read, update, and delete lead attributes.
21  
22 =cut
23  
24 #-------------------------------------------------------------------------------
25 # Lead Attributes Management
26 #-------------------------------------------------------------------------------
27  
28 =head2 ListAttributes
29  
30 my $data = $tomba->ListAttributes();
31  
32 Retrieve a list of lead attributes.
33  
34 See L<https://docs.tomba.io/api/lead-attributes#get-attributes>
35  
36 =cut
37  
38 0 ▶sub ListAttributes {
Subroutine ListAttributes: not called CC=1 SCAR=6.9
Pod documented
39 0 my ($self) = @_;
40 0 return $self->call(Tomba::Client::ATTRIBUTES_PATH);
41 }
42  
43 =head2 GetAttribute
44  
45 my $data = $tomba->GetAttribute($attribute_id);
46  
47 Retrieve details for a specific lead attribute.
48  
49 See L<https://docs.tomba.io/api/lead-attributes#get-attributes-attributeid>
50  
51 =cut
52  
53 0 ▶sub GetAttribute {
Subroutine GetAttribute: not called CC=1 SCAR=6.9
Pod documented
54 0 my ($self, $attribute_id) = @_;
55 0 return $self->call(Tomba::Client::ATTRIBUTES_PATH . "/$attribute_id");
56 }
57  
58 =head2 CreateAttribute
59  
60 my $data = $tomba->CreateAttribute({ name => "priority", type => "string" });
61  
62 Create a new lead attribute.
63  
64 See L<https://docs.tomba.io/api/lead-attributes#post-attributes>
65  
66 =cut
67  
68 0 ▶sub CreateAttribute {
Subroutine CreateAttribute: not called CC=1 SCAR=6.9
Pod documented
69 0 my ($self, $body) = @_;
70 0 return $self->post(Tomba::Client::ATTRIBUTES_PATH, $body);
71 }
72  
73 =head2 UpdateAttribute
74  
75 my $data = $tomba->UpdateAttribute($attribute_id, { name => "priority", type => "number" });
76  
77 Update a lead attribute.
78  
79 See L<https://docs.tomba.io/api/lead-attributes#put-attributes-attributeid>
80  
81 =cut
82  
83 0 ▶sub UpdateAttribute {
Subroutine UpdateAttribute: not called CC=1 SCAR=6.9
Pod documented
84 0 my ($self, $attribute_id, $body) = @_;
85 0 return $self->put(Tomba::Client::ATTRIBUTES_PATH . "/$attribute_id", $body);
86 }
87  
88 =head2 DeleteAttribute
89  
90 my $data = $tomba->DeleteAttribute($attribute_id);
91  
92 Delete a specific lead attribute.
93  
94 See L<https://docs.tomba.io/api/lead-attributes#delete-attributes-attributeid>
95  
96 =cut
97  
98 0 ▶sub DeleteAttribute {
Subroutine DeleteAttribute: not called CC=1 SCAR=6.9
Pod documented
99 0 my ($self, $attribute_id) = @_;
100 0 return $self->delete_request(Tomba::Client::ATTRIBUTES_PATH . "/$attribute_id");
101 }
102  
103 4 1;
104 __END__
« Leads.pm ↑ Summary LeadsList.pm »