Shopify/Model/Article.pm untested

filter: Statementstmt 0.0% 0 / 32 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 18 Podpod 0.0% 0 / 14 totaltotal 0.0% 0 / 66 CC 1 SCAR 6.9
CC
1
Cov
0%
fields
2.0
BEGIN
2.0
queries
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::Article;
9 use parent 'WWW::Shopify::Model::Item';
10  
11 my $fields; sub fields { return $fields; }
12 BEGIN { $fields = {
13 "author" => new WWW::Shopify::Field::String::Name(),
14 "body_html" => new WWW::Shopify::Field::Text::HTML(),
15 "summary_html" => new WWW::Shopify::Field::Text::HTML(),
16 "published" => new WWW::Shopify::Field::Boolean(),
17 "published_at" => new WWW::Shopify::Field::Date(),
18 "metafields" => new WWW::Shopify::Field::Relation::Many("WWW::Shopify::Model::Metafield"),
19 "tags" => new WWW::Shopify::Field::String::Words(1, 7),
20 "title" => new WWW::Shopify::Field::String::Words(1, 3),
21 "user_id" => new WWW::Shopify::Field::Relation::ReferenceOne('WWW::Shopify::Model::User'),
22 "id" => new WWW::Shopify::Field::Identifier(),
23 "handle" => new WWW::Shopify::Field::String::Handle(),
24 "blog_id" => new WWW::Shopify::Field::Relation::Parent('WWW::Shopify::Model::Blog'),
25 "image" => new WWW::Shopify::Field::Relation::OwnOne('WWW::Shopify::Model::Article::Image'),
26 "created_at" => new WWW::Shopify::Field::Date(),
27 "updated_at" => new WWW::Shopify::Field::Date(),
28 "template_suffix" => new WWW::Shopify::Field::String()
29 }; }
30  
31 my $queries; sub queries { return $queries; }
32 BEGIN { $queries = {
33 created_at_min => new WWW::Shopify::Query::LowerBound('created_at'),
34 created_at_max => new WWW::Shopify::Query::UpperBound('created_at'),
35 updated_at_min => new WWW::Shopify::Query::LowerBound('updated_at'),
36 updated_at_max => new WWW::Shopify::Query::UpperBound('updated_at'),
37 published_at_min => new WWW::Shopify::Query::LowerBound('published_at'),
38 published_at_max => new WWW::Shopify::Query::UpperBound('published_at'),
39 published_status => new WWW::Shopify::Query::Enum('published', ['published', 'unpublished', 'any']),
40 since_id => new WWW::Shopify::Query::LowerBound('id'),
41 handle => new WWW::Shopify::Query::Match('handle'),
42 }; }
43  
44 sub has_metafields { return 1; }
45 sub parent { return "WWW::Shopify::Model::Blog" }
46 sub creation_minimal { return qw(title); }
47 sub update_fields { return qw(author body_html summary_html published_at tags title metafields image); }
48 sub included_in_parent { return 0; }
49 # The docs say this should be 1, but embedded endpoints dont' pass the blog id, and you don't actually need this.
50 sub get_through_parent { return 1; }
51 sub update_through_parent { return 1; }
52 sub delete_through_parent { return 1; }
53  
54  
55 sub read_scope { return "read_content"; }
56 sub write_scope { return "write_content"; }
57  
58 eval(__PACKAGE__->generate_accessors); die $@ if $@;
59  
60 1