| 1 | package Net::PostcodeNL::WebshopAPI::Response; | ||
| 2 | use strict; | ||
| 3 | |||
| 4 | use parent 'Class::Accessor::Fast'; | ||
| 5 | |||
| 6 | Net::PostcodeNL::WebshopAPI::Response->mk_accessors( | ||
| 7 | qw/street city municipality province/, | ||
| 8 | qw/postcode houseNumber houseNumberAddition houseNumberAdditions/, | ||
| 9 | qw/surfaceArea purposes addressType/, | ||
| 10 | qw/bagNumberDesignationId bagAddressableObjectId/, | ||
| 11 | qw/rdX rdY longitude latitude/, | ||
| 12 | ); | ||
| 13 | |||
| 14 | sub new { | ||
| 15 | my ($class, $data) = @_; | ||
| 16 | my $self = bless { %$data }, $class; | ||
| 17 | return $self; | ||
| 18 | } | ||
| 19 | |||
| 20 | sub is_error { | ||
| 21 | my $self = shift; | ||
| 22 | return exists $self->{exception}; | ||
| 23 | } | ||
| 24 | |||
| 25 | sub err_str { | ||
| 26 | my $self = shift; | ||
| 27 | return $self->{exception}; | ||
| 28 | } | ||
| 29 | |||
| 30 | 1; |