| 1 | # | ||
| 2 | # This file is part of Net-Gandi | ||
| 3 | # | ||
| 4 | # This software is copyright (c) 2012 by Natal Ngétal. | ||
| 5 | # | ||
| 6 | # This is free software; you can redistribute it and/or modify it under | ||
| 7 | # the same terms as the Perl 5 programming language system itself. | ||
| 8 | # | ||
| 9 | package Net::Gandi::Hosting::Datacenter; | ||
| 10 | { | ||
| 11 | $Net::Gandi::Hosting::Datacenter::VERSION = '1.122180'; | ||
| 12 | } | ||
| 13 | |||
| 14 | # ABSTRACT: Datacenter interface | ||
| 15 | |||
| 16 | use Moose; | ||
| 17 | use MooseX::Params::Validate; | ||
| 18 | use namespace::autoclean; | ||
| 19 | |||
| 20 | use Net::Gandi::Types Client => { -as => 'Client_T' }; | ||
| 21 | |||
| 22 | has client => ( | ||
| 23 | is => 'rw', | ||
| 24 | isa => Client_T, | ||
| 25 | required => 1, | ||
| 26 | ); | ||
| 27 | |||
| 28 | |||
| 29 | sub list { | ||
| 30 | my ( $self, $params ) = validated_list( | ||
| 31 | \@_, | ||
| 32 | opts => { isa => 'HashRef', optional => 1 } | ||
| 33 | ); | ||
| 34 | |||
| 35 | $params ||= {}; | ||
| 36 | return $self->client->api_call( 'datacenter.list', $params ); | ||
| 37 | } | ||
| 38 | |||
| 39 | no Moose; | ||
| 40 | __PACKAGE__->meta->make_immutable; | ||
| 41 | |||
| 42 | 1; | ||
| 43 | |||
| 44 | __END__ |