1# -*- perl -*- 2# !!! DO NOT EDIT !!! 3# This file was automatically generated. 4package Net::Amazon::Validate::ItemSearch::jp::Format; 5 6use 5.006; 7use strict; 8use warnings; 9 10sub new { 11 my ($class , %options) = @_; 12 my $self = { 13 '_default' => 'Music', 14 %options, 15 }; 16 17 push @{$self->{_options}}, 'Apparel'; 18 push @{$self->{_options}}, 'Classical'; 19 push @{$self->{_options}}, 'DVD'; 20 push @{$self->{_options}}, 'Music'; 21 push @{$self->{_options}}, 'VHS'; 22 push @{$self->{_options}}, 'Video'; 23 24 bless $self, $class; 25} 26 27sub user_or_default { 28 my ($self, $user) = @_; 29 if (defined $user && length($user) > 0) { 30 return $self->find_match($user); 31 } 32 return $self->default(); 33} 34 35sub default { 36 my ($self) = @_; 37 return $self->{_default}; 38} 39 40sub find_match { 41 my ($self, $value) = @_; 42 for (@{$self->{_options}}) { 43 return $_ if lc($_) eq lc($value); 44 } 45 die "$value is not a valid value for jp::Format!\n"; 46} 47 481; 49 50__END__ 51 52=head1 NAME 53 54Net::Amazon::Validate::ItemSearch::jp::Format - valid search indices for the jp locale and the Format operation. 55 56=head1 DESCRIPTION 57 58The default value is Music, unless mode is specified. 59 60The list of available values are: 61 62 Apparel 63 Classical 64 DVD 65 Music 66 VHS 67 Video 68 69=cut 70