Shopify/Model/Order/LineItem.pm untested

filter: Statementstmt 0.0% 0 / 23 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 35 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::Order::LineItem;
9 use parent "WWW::Shopify::Model::NestedItem";
10  
11 my $fields; sub fields { return $fields; }
12 BEGIN { $fields = {
13 "fulfillable_quantity" => new WWW::Shopify::Field::Int(),
14 "fulfillment_service" => new WWW::Shopify::Field::String::Enum(["automatic", "manual"]),
15 "fulfillment_status" => new WWW::Shopify::Field::String(),
16 "grams" => new WWW::Shopify::Field::Int(),
17 "id" => new WWW::Shopify::Field::Identifier(),
18 "price" => new WWW::Shopify::Field::Money(),
19 # FINALLY
20 "total_discount" => new WWW::Shopify::Field::Money(),
21 # These are not always filled out. If a product is deleted, these are null.
22 "product_id" => new WWW::Shopify::Field::Relation::ReferenceOne('WWW::Shopify::Model::Product', 1),
23 "variant_id" => new WWW::Shopify::Field::Relation::ReferenceOne('WWW::Shopify::Model::Product::Variant', 1),
24 #
25 "gift_card" => new WWW::Shopify::Field::Boolean(),
26 "pre_tax_price" => new WWW::Shopify::Field::Money(),
27 "quantity" => new WWW::Shopify::Field::Int(1, 20),
28 "requires_shipping" => new WWW::Shopify::Field::Boolean(),
29 "product_exists" => new WWW::Shopify::Field::Boolean(),
30 "sku" => new WWW::Shopify::Field::String(),
31 "title" => new WWW::Shopify::Field::String::Words(1, 3),
32 "variant_title" => new WWW::Shopify::Field::String::Words(1,3),
33 "vendor" => new WWW::Shopify::Field::String(),
34 "name" => new WWW::Shopify::Field::String::Words(1, 3),
35 "discount_allocations" => new WWW::Shopify::Field::Relation::Many("WWW::Shopify::Model::Order::LineItem::DiscountAllocation"),
36 "properties" => new WWW::Shopify::Field::Relation::Many("WWW::Shopify::Model::Order::LineItem::Property"),
37 "tax_lines" => new WWW::Shopify::Field::Relation::Many("WWW::Shopify::Model::Order::LineItem::TaxLine"),
38 "origin_location" => new WWW::Shopify::Field::Relation::OwnOne("WWW::Shopify::Model::Order::LineItem::Location"),
39 "destination_location" => new WWW::Shopify::Field::Relation::OwnOne("WWW::Shopify::Model::Order::LineItem::Location"),
40 "taxable" => new WWW::Shopify::Field::Boolean(),
41 "variant_inventory_management" => new WWW::Shopify::Field::String::Enum(["shopify", "manual"]),
42
43
44 "pre_tax_price_set" => new WWW::Shopify::Field::Relation::OwnOne("WWW::Shopify::Model::Order::LineItem::PriceSet"),
45 "total_discount_set" => new WWW::Shopify::Field::Relation::OwnOne("WWW::Shopify::Model::Order::LineItem::PriceSet"),
46 "price_set" => new WWW::Shopify::Field::Relation::OwnOne("WWW::Shopify::Model::Order::LineItem::PriceSet"),
47 "duties" => new WWW::Shopify::Field::Relation::Many("WWW::Shopify::Model::Order::LineItem::Duties")
48 }; }
49  
50 sub singular { return 'line_item'; }
51  
52 eval(__PACKAGE__->generate_accessors); die $@ if $@;
53  
54 1