1package VM::EC2::DB::Option::Group;
2
3=head1 NAME
4
5VM::EC2::DB::Option::Group - An RDS Database Option Group
6
7=head1 SYNOPSIS
8
9 use VM::EC2;
10
11 $ec2 = VM::EC2->new(...);
12 @grps = $ec2->describe_option_groups();
13 print $_->OptionGroupName,': ',$_->EngineName,"\n" foreach @grps;
14
15=head1 DESCRIPTION
16
17This object represents a DB Option Group.  It is the result of a
18VM::EC2->create_option_group(), VM::EC2->describe_option_groups(), or
19VM::EC2->modify_option_group() call.
20
21=head1 STRING OVERLOADING
22
23In string context, the object returns the Option Group Name.
24
25=head1 SEE ALSO
26
27L<VM::EC2>
28L<VM::EC2::Generic>
29L<VM::EC2::DB::Instance>
30
31=head1 AUTHOR
32
33Lance Kinley E<lt>lkinley@loyaltymethods.comE<gt>.
34
35Copyright (c) 2013 Loyalty Methods, Inc.
36
37This package and its accompanying libraries is free software; you can
38redistribute it and/or modify it under the terms of the GPL (either
39version 1, or at your option, any later version) or the Artistic
40License 2.0.  Refer to LICENSE for the full license text. In addition,
41please see DISCLAIMER.txt for disclaimers of warranty.
42
43=cut
44
45use strict;
46use base 'VM::EC2::Generic';
47use VM::EC2::DB::Option;
48
49use overload '""' => sub { shift->OptionGroupName },
50    fallback => 1;
51
52sub valid_fields {
53    my $self = shift;
54    return qw(AllowsVpcAndNonVpcInstanceMemberships
55              EngineName
56              MajorEngineVersion
57              OptionGroupDescription
58              OptionGroupName
59              Options
60              VpcId);
61}
62
63sub AllowsVpcAndNonVpcInstanceMemberships {
64    my $self = shift;
65    my $allows = $self->SUPER::AllowsVpcAndNonVpcInstanceMemberships;
66    return $allows eq 'true';
67}
68
69sub Options {
70    my $self = shift;
71    my $options = $self->SUPER::Options;
72    return unless $options;
73    $options = $options->{Option};
74    return ref $options eq 'HASH' ?
75        (VM::EC2::DB::Option->new($options,$self->aws)) :
76        map { VM::EC2::DB::Option->new($_,$self->aws) } @$options;
77}
78
791;
80