| 1 | #!/usr/bin/perl | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | use WWW::Shopify; | ||
| 7 | |||
| 8 | package WWW::Shopify::Model::Collection; | ||
| 9 | use parent "WWW::Shopify::Model::Item"; | ||
| 10 | |||
| 11 | my $fields; sub fields { return $fields; } | ||
| 12 | BEGIN { $fields = { | ||
| 13 | "body_html" => new WWW::Shopify::Field::String::HTML(), | ||
| 14 | "handle" => new WWW::Shopify::Field::String::Handle(), | ||
| 15 | "updated_at" => new WWW::Shopify::Field::Date(), | ||
| 16 | "published" => new WWW::Shopify::Field::Boolean(), | ||
| 17 | "published_scope" => new WWW::Shopify::Field::String::Enum(["global"]), | ||
| 18 | "collection_type" => new WWW::Shopify::Field::String::Enum(["custom", "smart"]), | ||
| 19 | "published_at" => new WWW::Shopify::Field::Date(), | ||
| 20 | "id" => new WWW::Shopify::Field::Identifier(), | ||
| 21 | "sort_order" => new WWW::Shopify::Field::String::Enum(["manual", "best-selling", "alpha-asc", "alpha-desc", "price-asc", "price-desc", "created", "created-desc"]), | ||
| 22 | "template_suffix" => new WWW::Shopify::Field::String(), | ||
| 23 | "metafields" => new WWW::Shopify::Field::Relation::Many("WWW::Shopify::Model::Metafield"), | ||
| 24 | "image" => new WWW::Shopify::Field::Relation::OwnOne('WWW::Shopify::Model::Collection::Image'), | ||
| 25 | "title" => new WWW::Shopify::Field::String::Words(1, 2), | ||
| 26 | }; } | ||
| 27 | my $queries; sub queries { return $queries; } | ||
| 28 | BEGIN { $queries = { | ||
| 29 | created_at_min => new WWW::Shopify::Query::LowerBound('created_at'), | ||
| 30 | created_at_max => new WWW::Shopify::Query::UpperBound('created_at'), | ||
| 31 | updated_at_min => new WWW::Shopify::Query::LowerBound('updated_at'), | ||
| 32 | updated_at_max => new WWW::Shopify::Query::UpperBound('updated_at'), | ||
| 33 | }; } | ||
| 34 | |||
| 35 | sub gettable { return undef; } | ||
| 36 | sub singlable { 1; } | ||
| 37 | sub creatable { return undef; } | ||
| 38 | sub updatable { return undef; } | ||
| 39 | |||
| 40 | sub creation_minimal { return qw(title); } | ||
| 41 | sub creation_filled { return qw(public_url created_at); } | ||
| 42 | sub update_filled { return qw(updated_at); } | ||
| 43 | sub update_fields { return qw(body_html handle sort_order template_suffix title image); } | ||
| 44 | sub throws_webhooks { return 1; } | ||
| 45 | |||
| 46 | sub has_metafields { return 1; } | ||
| 47 | |||
| 48 | sub read_scope { return "read_products"; } | ||
| 49 | sub write_scope { return "write_products"; } | ||
| 50 | |||
| 51 | eval(__PACKAGE__->generate_accessors); die $@ if $@; | ||
| 52 | |||
| 53 | 1; |