| 1 | #!/usr/bin/perl | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | use WWW::Shopify; | ||
| 7 | |||
| 8 | package WWW::Shopify::Model::Checkout::LineItem; | ||
| 9 | use parent 'WWW::Shopify::Model::Order::LineItem'; | ||
| 10 | |||
| 11 | sub identifier { qw() } | ||
| 12 | |||
| 13 | my $line_item_fields; sub fields { return $line_item_fields; } | ||
| 14 | BEGIN { | ||
| 15 | my %permitted_fields = map { $_ => 1 } qw(compare_at_price fulfillment_service grams id line_price price properties quantity requires_shipping sku taxable title product_id variant_id variant_title name vendor); | ||
| 16 | my $parent_fields = WWW::Shopify::Model::Order::LineItem->fields; | ||
| 17 | |||
| 18 | $line_item_fields = { map { $_ => $parent_fields->{$_} } grep { exists $permitted_fields{$_} } keys(%$parent_fields) }; | ||
| 19 | $line_item_fields->{id} = new WWW::Shopify::Field::Identifier::String(); | ||
| 20 | $line_item_fields->{id}->name('id'); | ||
| 21 | |||
| 22 | $line_item_fields->{properties} = new WWW::Shopify::Field::Freeform("WWW::Shopify::Model::Checkout::LineItem::Property"); | ||
| 23 | $line_item_fields->{properties}->name('properties'); | ||
| 24 | } | ||
| 25 | |||
| 26 | 1; |