Amazon-MWS
view release on metacpan or search on metacpan
lib/Amazon/MWS/XML/Order.pm view on Meta::CPAN
package Amazon::MWS::XML::Order;
use Amazon::MWS::XML::Address;
use Amazon::MWS::XML::OrderlineItem;
use strict;
use warnings;
use DateTime;
use DateTime::Format::ISO8601;
use Data::Dumper;
use Moo;
use MooX::Types::MooseLike::Base qw(:all);
use namespace::clean;
=head1 NAME
Amazon::MWS::XML::Order
=head1 DESCRIPTION
Class to handle the xml structures returned by ListOrders and
ListOrderItems.
The constructor is meant to be called by L<Amazon::MWS::Uploader> when
C<get_orders> is called. A list of objects of this class will be
returned.
=head1 SYNOPSIS
my $order = Amazon::MWS::XML::Order->new(order => $struct, orderline => \@struct);
my @items = $order->items;
print $order->order_number, $order->amazon_order_number;
=head1 ACCESSORS
They should be passed to the constructor and are complex structures
parsed from the output of L<Amazon::MWS::Client>.
=head2 order
It should be the output of C<ListOrders> or C<GetOrder> without the
root, e.g. C<$response->{Orders}->{Order}->[0]>
Field description:
http://docs.developer.amazonservices.com/en_US/orders/2013-09-01/Orders_GetOrder.html
=head2 orderline
It should be the output of C<ListOrderItems> without the root, like
C<$response->{OrderItems}->{OrderItem}>.
=head2 retrieve_orderline_sub
If you want to save API calls, instead of initialize the orderline,
you may want to pass a subroutine (which will accept no arguments, so
it should be a closure) to the constructor instead, which will be
called lazily if the object needs to access the orderline.
=head2 order_number
Our order ID.
=head2 shipping_address
Shipping address as C<Amazon::MWS::Client::Address> object.
=cut
( run in 0.710 second using v1.01-cache-2.11-cpan-39bf76dae61 )