Shopify/Model/GiftCard.pm untested

filter: Statementstmt 0.0% 0 / 32 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 19 Podpod 0.0% 0 / 15 totaltotal 0.0% 0 / 68 CC 1 SCAR 6.9
CC
1
Cov
0%
fields
2.0
BEGIN
2.0
singular
2.0
CRAP 2.0
1 #!/usr/bin/perl
2  
3 use strict;
4 use warnings;
5  
6 use WWW::Shopify;
7  
8 package WWW::Shopify::Model::GiftCard;
9 use parent "WWW::Shopify::Model::Item";
10  
11 my $fields; sub fields { return $fields; }
12 BEGIN { $fields = {
13 "api_client_id" => new WWW::Shopify::Field::String(),
14 "balance" => new WWW::Shopify::Field::Money(),
15 "created_at" => new WWW::Shopify::Field::Date(),
16 "currency" => new WWW::Shopify::Field::Currency(),
17 "customer_id" => new WWW::Shopify::Field::Relation::ReferenceOne("WWW::Shopify::Model::Customer"),
18 "disabled_at" => new WWW::Shopify::Field::Date(),
19 "expires_on" => new WWW::Shopify::Field::Date(),
20 "id" => new WWW::Shopify::Field::Identifier(),
21 "initial_value" => new WWW::Shopify::Field::Money(),
22 "order_id" => new WWW::Shopify::Field::Relation::ReferenceOne("WWW::Shopify::Model::Order"),
23 "line_item_id" => new WWW::Shopify::Field::Relation::ReferenceOne("WWW::Shopify::Model::Order::LineItem"),
24 "note" => new WWW::Shopify::Field::String(),
25 "template_suffix" => new WWW::Shopify::Field::String(),
26 "updated_at" => new WWW::Shopify::Field::Date(),
27 "user_id" => new WWW::Shopify::Field::Relation::ReferenceOne("WWW::Shopify::Model::User"),
28 "code" => new WWW::Shopify::Field::String(),
29 "masked_code" => new WWW::Shopify::Field::String::Regex('···· ···· ···· \w{4}'),
30 "last_characters" => new WWW::Shopify::Field::String::Regex('\w{4}'),
31 }; }
32 sub singular { return 'gift_card'; }
33 sub creation_minimal { return qw(initial_value code); }
34 sub creation_filled { return qw(created_at); }
35 sub update_filled { return qw(updated_at); }
36 sub get_fields { return grep { $_ ne "code" } keys(%{$_[0]->fields}); }
37  
38 sub actions { return qw(disable enable); }
39  
40 sub needs_plus { return 1; }
41 sub error_codes_if_unavailable { (403, 404) }
42  
43 sub searchable($) { return 1; }
44  
45 sub read_scope { return "read_gift_cards"; }
46 sub write_scope { return "write_gift_cards"; }
47 sub actually_needs_scope { 0; }
48  
49 sub update_fields { return qw(expires_on note template_suffix); }
50  
51 eval(__PACKAGE__->generate_accessors); die $@ if $@;
52  
53 1;