Index: /trunk/DataStore/MANIFEST
===================================================================
--- /trunk/DataStore/MANIFEST	(revision 6541)
+++ /trunk/DataStore/MANIFEST	(revision 6542)
@@ -13,4 +13,5 @@
 lib/DataStore/Product.pm
 lib/DataStore/Record.pm
+lib/DataStore/Response.pm
 t/00_distribution.t
 t/01_load.t
@@ -21,2 +22,3 @@
 t/06_fileset.t
 t/07_file.t
+t/08_response.t
Index: /trunk/DataStore/lib/DataStore/Response.pm
===================================================================
--- /trunk/DataStore/lib/DataStore/Response.pm	(revision 6542)
+++ /trunk/DataStore/lib/DataStore/Response.pm	(revision 6542)
@@ -0,0 +1,92 @@
+# Copyright (C) 2006  Joshua Hoblitt
+#
+# $Id: Response.pm,v 1.1 2006-03-08 02:11:46 jhoblitt Exp $
+
+package DataStore::Response;
+
+use strict;
+use warnings;
+
+use vars qw($VERSION);
+$VERSION = '0.01';
+
+use base qw( Class::Accessor::Fast );
+
+use Params::Validate qw( validate ARRAYREF BOOLEAN SCALAR );
+
+use vars qw( @BASE_FIELDS );
+
+@BASE_FIELDS = qw( is_success code status_line data request );
+
+__PACKAGE__->mk_accessors(@BASE_FIELDS);
+
+=pod
+
+=head1 NAME
+
+DataStore::Response - represents a DataStore response
+
+=head1 SYNOPSIS
+
+    use DataStore::Response;
+
+    my $dsr = DateStore::Response->new(...);
+
+=head1 DESCRIPTION
+
+=head1 USAGE
+
+=head2 Import Parameters
+
+This module accepts no arguments to it's C<import> method and exports no
+I<symbols>.
+
+=head2 Methods
+
+=head3 Constructors
+
+=over 4
+
+=item * C<new()>
+
+=cut
+
+sub new
+{
+    my $class = shift;
+
+    my %p = validate(@_,
+        {
+            is_success  => {
+                type        => BOOLEAN,
+                callbacks   => {
+                    'is 0, 1, or undef' =>
+                        sub { ! defined( $_[0] ) || $_[0] == 0 || $_[0] == 1 },
+                },
+            },
+            code        => {
+                type        => SCALAR,
+                regex       => qr/^\d{3}$/,
+            },
+            status_line => {
+                type        => SCALAR,
+                regex       => qr/\S+/, # string with atleast 1 non WS char
+
+            },
+            data        => {
+                type        => SCALAR | ARRAYREF,
+            },
+            request     => {
+                isa         => qw( DataStore::Record ),
+            },
+        }
+    );
+
+    my $self = bless \%p, ref $class || $class;
+
+    return $self;
+}
+
+1;
+
+__END__
Index: /trunk/DataStore/t/01_load.t
===================================================================
--- /trunk/DataStore/t/01_load.t	(revision 6541)
+++ /trunk/DataStore/t/01_load.t	(revision 6542)
@@ -5,10 +5,11 @@
 use lib qw( ./lib ./t );
 
-use Test::More tests => 6;
+use Test::More tests => 7;
 
-BEGIN { use_ok( 'DataStore::File' ); }
-BEGIN { use_ok( 'DataStore::File::Parser' ); }
-BEGIN { use_ok( 'DataStore::FileSet' ); }
-BEGIN { use_ok( 'DataStore::FileSet::Parser' ); }
-BEGIN { use_ok( 'DataStore::Product' ); }
-BEGIN { use_ok( 'DataStore::Record' ); }
+BEGIN { use_ok('DataStore::File'); }
+BEGIN { use_ok('DataStore::File::Parser'); }
+BEGIN { use_ok('DataStore::FileSet'); }
+BEGIN { use_ok('DataStore::FileSet::Parser'); }
+BEGIN { use_ok('DataStore::Product'); }
+BEGIN { use_ok('DataStore::Record'); }
+BEGIN { use_ok('DataStore::Response'); }
Index: /trunk/DataStore/t/08_response.t
===================================================================
--- /trunk/DataStore/t/08_response.t	(revision 6542)
+++ /trunk/DataStore/t/08_response.t	(revision 6542)
@@ -0,0 +1,102 @@
+#!/usr/bin/env perl
+
+# Copyright (C) 2006  Joshua Hoblitt
+#
+# $Id: 08_response.t,v 1.1 2006-03-08 02:11:46 jhoblitt Exp $
+
+use strict;
+use warnings;
+
+use lib qw( ./lib ./t );
+
+use Test::More tests => 9;
+
+=head1 NAME
+
+t/08_response.t - tests DataStore::Response
+
+=head1 SYNOPSIS
+    
+    prove t/08_response.t
+
+=cut
+
+use CGI;
+use DataStore::Product;
+use DataStore::Response;
+
+can_ok('DataStore::Response', qw(
+    new
+    is_success
+    code
+    status_line
+    data
+    request
+));
+
+# ->new()
+
+{
+    my $dsr = DataStore::Response->new(
+        is_success  => undef,
+        code        => 500,
+        status_line => 'foo',
+        data        => 'bar',
+        request     => DataStore::Product->new( uri => 'http://example.org/' ),
+    );
+
+    isa_ok($dsr, 'DataStore::Response');
+}
+
+eval {
+    my $dsr = DataStore::Response->new(
+        is_success   => undef,
+        code        => 500,
+        status_line => 'foo',
+        data        => 'bar',
+        request     => DataStore::Product->new( uri => 'http://example.org/' ),
+        foo         => 1,
+    );
+};
+like($@, qr/not listed in the validation options/,
+    '->new() fails whe passed extra params');
+
+eval {
+    my $dsr = DataStore::Response->new( is_success => 2 );
+};
+like($@, qr/is 0, 1, or undef/,
+    '->new() fails when is_success is not valid');
+
+eval {
+    my $dsr = DataStore::Response->new( code => 5000 );
+};
+like($@, qr/did not pass regex check/,
+    '->new() fails when code is not valid');
+
+eval {
+    my $dsr = DataStore::Response->new( status_line => '' );
+};
+like($@, qr/did not pass regex check/,
+    '->new() fails when status_line is not valid');
+
+eval {
+    my $dsr = DataStore::Response->new( data => undef );
+};
+like($@, qr/is not one of the allowed types/,
+    '->new() fails when data is not valid');
+
+eval {
+    my $dsr = DataStore::Response->new(
+        request => CGI->new,
+    );
+};
+like($@, qr/was not a 'DataStore::Record' /,
+    '->new() fails when response is not valid');
+
+eval {
+    my $dsr = DataStore::Response->new;
+};
+like($@, qr/Mandatory parameters/,
+    '->new() fails when not passed all manadator params');
+
+# accessor tests unneeded as they are all generated by Class::Accessor::Fast
