| 1 | package Webservice::OVH::Hosting; | ||
| 2 | |||
| 3 | =encoding utf-8 | ||
| 4 | |||
| 5 | =head1 NAME | ||
| 6 | |||
| 7 | Webservice::OVH::Hosting | ||
| 8 | |||
| 9 | =head1 SYNOPSIS | ||
| 10 | |||
| 11 | =head1 DESCRIPTION | ||
| 12 | |||
| 13 | Gives access to hostings | ||
| 14 | |||
| 15 | =head1 METHODS | ||
| 16 | |||
| 17 | =cut | ||
| 18 | |||
| 19 | use strict; | ||
| 20 | use warnings; | ||
| 21 | use Carp qw{ carp croak }; | ||
| 22 | |||
| 23 | our $VERSION = 0.47; | ||
| 24 | |||
| 25 | use Webservice::OVH::Hosting::Web; | ||
| 26 | |||
| 27 | =head2 _new | ||
| 28 | |||
| 29 | Internal Method to create the hosting object. | ||
| 30 | This method is not ment to be called external. | ||
| 31 | |||
| 32 | =over | ||
| 33 | |||
| 34 | =item * Parameter: $api_wrapper - ovh api wrapper object, $module - root object | ||
| 35 | |||
| 36 | =item * Return: L<Webservice::OVH::Order> | ||
| 37 | |||
| 38 | =item * Synopsis: Webservice::OVH::Order->_new($ovh_api_wrapper, $self); | ||
| 39 | |||
| 40 | =back | ||
| 41 | |||
| 42 | =cut | ||
| 43 | |||
| 44 | sub _new { | ||
| 45 | |||
| 46 | my ( $class, %params ) = @_; | ||
| 47 | |||
| 48 | die "Missing module" unless $params{module}; | ||
| 49 | die "Missing wrapper" unless $params{wrapper}; | ||
| 50 | |||
| 51 | my $module = $params{module}; | ||
| 52 | my $api_wrapper = $params{wrapper}; | ||
| 53 | |||
| 54 | my $web = Webservice::OVH::Hosting::Web->_new( wrapper => $api_wrapper, module => $module ); | ||
| 55 | |||
| 56 | my $self = bless { _module => $module, _api_wrapper => $api_wrapper, _web => $web }, $class; | ||
| 57 | |||
| 58 | return $self; | ||
| 59 | } | ||
| 60 | |||
| 61 | sub web { | ||
| 62 | |||
| 63 | my ($self) = @_; | ||
| 64 | |||
| 65 | return $self->{_web}; | ||
| 66 | } | ||
| 67 | |||
| 68 | 1; |