| 1 | package plenigo::Configuration; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | plenigo::Configuration - Contains all base configuration settings. | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | use plenigo::Configuration; | ||
| 10 | |||
| 11 | # Prepare configuration | ||
| 12 | |||
| 13 | my $use_stage = 0; # set if stage system should be used | ||
| 14 | my $configuration = plenigo::Configuration->new(access_token => 'ACCESS_TOKEN', use_stage => $use_stage); | ||
| 15 | |||
| 16 | =head1 DESCRIPTION | ||
| 17 | |||
| 18 | plenigo::Configuration contains all base configuration settings. | ||
| 19 | |||
| 20 | =cut | ||
| 21 | |||
| 22 | use Moo; | ||
| 23 | use Carp qw(confess); | ||
| 24 | |||
| 25 | our $VERSION = '3.0002'; | ||
| 26 | |||
| 27 | has access_token => ( | ||
| 28 | is => 'ro', | ||
| 29 | required => 1 | ||
| 30 | ); | ||
| 31 | |||
| 32 | has use_stage => ( | ||
| 33 | is => 'ro', | ||
| 34 | default => 0 | ||
| 35 | ); | ||
| 36 | |||
| 37 | has api_host => ( | ||
| 38 | is => 'rw', | ||
| 39 | default => 'https://api.plenigo.com' | ||
| 40 | ); | ||
| 41 | |||
| 42 | has api_host_stage => ( | ||
| 43 | is => 'rw', | ||
| 44 | default => 'https://api.plenigo-stage.com' | ||
| 45 | ); | ||
| 46 | |||
| 47 | has api_url => ( | ||
| 48 | is => 'rw', | ||
| 49 | default => '/api/v3.0/' | ||
| 50 | ); | ||
| 51 | |||
| 52 | 1; |