| 1 | #!/usr/bin/perl | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | package WWW::Shopify::Model::InventoryLevel; | ||
| 7 | use parent "WWW::Shopify::Model::Item"; | ||
| 8 | |||
| 9 | my $fields; sub fields { return $fields; } | ||
| 10 | BEGIN { $fields = { | ||
| 11 | "available" => new WWW::Shopify::Field::Int(), | ||
| 12 | "available_adjustment" => new WWW::Shopify::Field::Int(), | ||
| 13 | "inventory_item_id" => new WWW::Shopify::Field::Relation::ReferenceOne("WWW::Shopify::Model::InventoryItem"), | ||
| 14 | "location_id" => new WWW::Shopify::Field::Relation::ReferenceOne("WWW::Shopify::Model::Location"), | ||
| 15 | "updated_at" => new WWW::Shopify::Field::Date() | ||
| 16 | }; } | ||
| 17 | my $queries; sub queries { return $queries; } | ||
| 18 | BEGIN { $queries = { | ||
| 19 | inventory_item_ids => new WWW::Shopify::Query::MultiMatch('inventory_item_id'), | ||
| 20 | location_ids => new WWW::Shopify::Query::MultiMatch('location_id') | ||
| 21 | }; } | ||
| 22 | |||
| 23 | sub actions { qw(set connect adjust) } | ||
| 24 | sub identifier { qw(inventory_item_id location_id) } | ||
| 25 | sub read_scope { return "read_inventory"; } | ||
| 26 | sub write_scope { return "write_inventory"; } | ||
| 27 | |||
| 28 | eval(__PACKAGE__->generate_accessors); die $@ if $@; | ||
| 29 | |||
| 30 | 1 |