| 1 | #!/usr/bin/perl | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | use WWW::Shopify; | ||
| 7 | |||
| 8 | package WWW::Shopify::Model::Menu; | ||
| 9 | use parent "WWW::Shopify::Model::Item"; | ||
| 10 | |||
| 11 | my $fields; sub fields { return $fields; } | ||
| 12 | BEGIN { $fields = { | ||
| 13 | "handle" => new WWW::Shopify::Field::String::Handle(), | ||
| 14 | "title" => new WWW::Shopify::Field::String(), | ||
| 15 | "id" => new WWW::Shopify::Field::Identifier(), | ||
| 16 | # "default" => new WWW::Shopify::Field::Boolean(), | ||
| 17 | "items" => new WWW::Shopify::Field::Relation::Many("WWW::Shopify::Model::Menu::Item") | ||
| 18 | }; } | ||
| 19 | sub countable { return undef; } | ||
| 20 | |||
| 21 | sub creation_minimal { return qw(handle); } | ||
| 22 | sub creation_filled { return qw(id); } | ||
| 23 | sub update_fields { return qw(handle title links); } | ||
| 24 | sub update_filled { return qw(); } | ||
| 25 | |||
| 26 | sub needs_login { return 1; } | ||
| 27 | # Shopify recently just killed all their JSON apis for non-api stuff. Why? Who knows? | ||
| 28 | # They're just delaying the inevitable. | ||
| 29 | sub needs_form_encoding_create { return 1; } | ||
| 30 | sub needs_form_encoding_update { return 1; } | ||
| 31 | sub needs_form_encoding_delete { return 1; } | ||
| 32 | |||
| 33 | eval(__PACKAGE__->generate_accessors); die $@ if $@; | ||
| 34 | |||
| 35 | 1; |