RT# 82949 - changes section name from fees to pricing, better opiton
[freeside.git] / httemplate / REST / 1.0 / cust_pkg
1 <% encode_rest($return) %>\
2 <%init>
3
4 rest_auth($cgi);
5
6 my( $pkgnum, $command ) = split('/', rest_uri_remain($r, $m), 2 );
7
8 if ( $r->method eq 'GET' ) {
9
10   my $return = [];
11
12   if ( $pkgnum ) {
13
14     my $cust_pkg = qsearchs('cust_main', { 'pkgnum'=>$pkgnum } )
15       or die "unknown pkgnum $pkgnum";
16
17     if ( $command eq '' ) {
18
19       $return = $cust_pkg->API_getinfo;
20
21     } elsif ( $command eq 'cust_svc' ) {
22
23       $return = [ map $_->API_getinfo, $cust_pkg->cust_svc ];
24
25     }
26
27
28
29   #} else { #list
30
31   }
32
33 } elsif ( $r->method eq 'POST' ) { #create new
34
35 } elsif ( $r->method eq 'PUT' ) { #modify
36
37 }
38
39 </%init>