| 1 | #!/usr/bin/perl | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | use WWW::Shopify; | ||
| 7 | |||
| 8 | package WWW::Shopify::Model::Address; | ||
| 9 | use parent "WWW::Shopify::Model::NestedItem"; | ||
| 10 | |||
| 11 | my $fields; sub fields { return $fields; } | ||
| 12 | BEGIN { $fields = { | ||
| 13 | "id" => new WWW::Shopify::Field::Identifier(), | ||
| 14 | "address1" => new WWW::Shopify::Field::String::Address(), | ||
| 15 | "address2" => new WWW::Shopify::Field::String::Address(), | ||
| 16 | "city" => new WWW::Shopify::Field::String::City(), | ||
| 17 | "company" => new WWW::Shopify::Field::String::Words(1, 3), | ||
| 18 | "country" => new WWW::Shopify::Field::String::Country(), | ||
| 19 | "first_name" => new WWW::Shopify::Field::String::FirstName(), | ||
| 20 | "last_name" => new WWW::Shopify::Field::String::LastName(), | ||
| 21 | "latitude" => new WWW::Shopify::Field::Float(-90, 90), | ||
| 22 | "longitude" => new WWW::Shopify::Field::Float(-180, 180), | ||
| 23 | "phone" => new WWW::Shopify::Field::String::Phone(), | ||
| 24 | "province" => new WWW::Shopify::Field::String::Words(1), | ||
| 25 | "zip" => new WWW::Shopify::Field::String::Zip(), | ||
| 26 | "name" => new WWW::Shopify::Field::String::Words(1, 3), | ||
| 27 | "country_code" => new WWW::Shopify::Field::String::CountryCode(), | ||
| 28 | "province_code" => new WWW::Shopify::Field::String::ProvinceCode(), | ||
| 29 | "default" => new WWW::Shopify::Field::Boolean() | ||
| 30 | }; } | ||
| 31 | sub plural { return 'addresses'; } | ||
| 32 | sub parent { return undef; } | ||
| 33 | |||
| 34 | # Addresses are always included in both customer and order objects. | ||
| 35 | sub included_in_parent { return 1; } | ||
| 36 | |||
| 37 | eval(__PACKAGE__->generate_accessors); die $@ if $@; | ||
| 38 | |||
| 39 | 1; |