add function for retrieving treatment info by observation unit ids
[sgn.git] / lib / CXGN / BrAPI.pm
blobc95b66b42151c880fcb3f8d9ceb39cee781e5545
1 package CXGN::BrAPI;
3 use Moose;
4 use Data::Dumper;
5 use CXGN::BrAPI::v1::Authentication;
6 use CXGN::BrAPI::v1::Calls;
7 use CXGN::BrAPI::v1::Crops;
8 use CXGN::BrAPI::v1::ObservationVariables;
9 use CXGN::BrAPI::v1::Studies;
10 use CXGN::BrAPI::v1::Germplasm;
11 use CXGN::BrAPI::v1::GermplasmAttributes;
12 use CXGN::BrAPI::v1::Trials;
13 use CXGN::BrAPI::v1::Markerprofiles;
14 use CXGN::BrAPI::v1::Programs;
15 use CXGN::BrAPI::v1::Locations;
16 use CXGN::BrAPI::v1::Phenotypes;
17 use CXGN::BrAPI::v1::Traits;
18 use CXGN::BrAPI::v1::GenomeMaps;
19 use CXGN::BrAPI::v1::Samples;
20 use CXGN::BrAPI::v1::VendorSamples;
21 use CXGN::BrAPI::v1::Observations;
22 use CXGN::BrAPI::v1::ObservationUnits;
23 use CXGN::BrAPI::v1::ObservationTables;
24 use CXGN::BrAPI::v1::ServerInfo;
25 use CXGN::BrAPI::v1::Results;
26 use CXGN::BrAPI::v1::Images;
27 use CXGN::BrAPI::v1::Markers;
28 use CXGN::BrAPI::v1::Variables;
29 use CXGN::BrAPI::v2::Authentication;
30 use CXGN::BrAPI::v2::BreedingMethods;
31 use CXGN::BrAPI::v2::Calls;
32 use CXGN::BrAPI::v2::CommonCropNames;
33 use CXGN::BrAPI::v2::CallSets;
34 use CXGN::BrAPI::v2::Crossing;
35 use CXGN::BrAPI::v2::GenomeMaps;
36 use CXGN::BrAPI::v2::Germplasm;
37 use CXGN::BrAPI::v2::GermplasmAttributes;
38 use CXGN::BrAPI::v2::GermplasmAttributeValues;
39 use CXGN::BrAPI::v2::Events;
40 use CXGN::BrAPI::v2::Images;
41 use CXGN::BrAPI::v2::Lists;
42 use CXGN::BrAPI::v2::Locations;
43 use CXGN::BrAPI::v2::MarkerPositions;
44 use CXGN::BrAPI::v2::Nirs;
45 use CXGN::BrAPI::v2::Observations;
46 use CXGN::BrAPI::v2::ObservationTables;
47 use CXGN::BrAPI::v2::ObservationUnits;
48 use CXGN::BrAPI::v2::ObservationVariables;
49 use CXGN::BrAPI::v2::People;
50 use CXGN::BrAPI::v2::Programs;
51 use CXGN::BrAPI::v2::ReferenceSets;
52 use CXGN::BrAPI::v2::References;
53 use CXGN::BrAPI::v2::Results;
54 use CXGN::BrAPI::v2::Samples;
55 use CXGN::BrAPI::v2::Seasons;
56 use CXGN::BrAPI::v2::SeedLots;
57 use CXGN::BrAPI::v2::ServerInfo;
58 use CXGN::BrAPI::v2::Studies;
59 use CXGN::BrAPI::v2::Traits;
60 use CXGN::BrAPI::v2::Trials;
61 use CXGN::BrAPI::v2::Variants;
62 use CXGN::BrAPI::v2::VariantSets;
65 has 'version' => (
66 isa => 'Str',
67 is => 'rw',
68 required => 1,
71 has 'brapi_module_inst' => (
72 isa => 'HashRef',
73 is => 'rw',
74 required => 1,
77 sub brapi_wrapper {
78 my $self = shift;
79 my $module = shift;
81 my $brapi_package = 'CXGN::BrAPI::'.$self->version().'::'.$module;
82 push @{$self->brapi_module_inst->{status}}, { 'INFO' => "Loading $brapi_package" };
83 my $brapi_module = $brapi_package->new($self->brapi_module_inst);
84 return $brapi_module;