| 1 | package VM::EC2::DB::Engine::Version; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | VM::EC2::DB::Engine::Version - An RDS Database Engine Version | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | use VM::EC2; | ||
| 10 | $ec2 = VM::EC2->new(...); | ||
| 11 | @versions = $ec2->describe_db_engine_versions; | ||
| 12 | print $_,"\n" foreach grep { $_->Engine eq 'mysql' } @versions; | ||
| 13 | |||
| 14 | =head1 DESCRIPTION | ||
| 15 | |||
| 16 | This object represents a DB Engine Version, returned from a call to | ||
| 17 | VM::EC2->describe_db_engine_versions(). | ||
| 18 | |||
| 19 | =head1 STRING OVERLOADING | ||
| 20 | |||
| 21 | In string context, this object return the DBEngineVersionDescription. | ||
| 22 | |||
| 23 | =head1 SEE ALSO | ||
| 24 | |||
| 25 | L<VM::EC2> | ||
| 26 | L<VM::EC2::Generic> | ||
| 27 | L<VM::EC2::DB::Instance> | ||
| 28 | |||
| 29 | =head1 AUTHOR | ||
| 30 | |||
| 31 | Lance Kinley E<lt>lkinley@loyaltymethods.comE<gt>. | ||
| 32 | |||
| 33 | Copyright (c) 2013 Loyalty Methods, Inc. | ||
| 34 | |||
| 35 | This package and its accompanying libraries is free software; you can | ||
| 36 | redistribute it and/or modify it under the terms of the GPL (either | ||
| 37 | version 1, or at your option, any later version) or the Artistic | ||
| 38 | License 2.0. Refer to LICENSE for the full license text. In addition, | ||
| 39 | please see DISCLAIMER.txt for disclaimers of warranty. | ||
| 40 | |||
| 41 | =cut | ||
| 42 | |||
| 43 | use strict; | ||
| 44 | use base 'VM::EC2::Generic'; | ||
| 45 | use VM::EC2::DB::CharacterSet; | ||
| 46 | |||
| 47 | use overload '""' => sub { shift->DBEngineVersionDescription }, | ||
| 48 | fallback => 1; | ||
| 49 | |||
| 50 | |||
| 51 | sub valid_fields { | ||
| 52 | my $self = shift; | ||
| 53 | return qw(DBEngineDescription DBEngineVersionDescription DBParameterGroupFamily | ||
| 54 | DefaultCharacterSet Engine EngineVersion SupportedCharacterSets); | ||
| 55 | } | ||
| 56 | |||
| 57 | sub DefaultCharacterSet { | ||
| 58 | my $self = shift; | ||
| 59 | my $charset = $self->SUPER::DefaultCharacterSet; | ||
| 60 | return VM::EC2::DB::CharacterSet->new($charset,$self->aws); | ||
| 61 | } | ||
| 62 | |||
| 63 | sub SupportedCharacterSets { | ||
| 64 | my $self = shift; | ||
| 65 | my $charsets = $self->SUPER::SupportedCharacterSets; | ||
| 66 | return map { VM::EC2::DB::CharacterSet->new($_,$self->aws) } @{$charsets->{CharacterSet}}; | ||
| 67 | } | ||
| 68 | |||
| 69 | sub engine_description { shift->DBEngineDescription } | ||
| 70 | |||
| 71 | sub description { shift->DBEngineVersionDescription } | ||
| 72 | |||
| 73 | sub param_group_family { shift->DBParameterGroupFamily } | ||
| 74 | |||
| 75 | sub default_charset { shift->DefaultCharacterSet } | ||
| 76 | |||
| 77 | sub supported_charsets { shift->SupportedCharacterSets } | ||
| 78 | |||
| 79 | 1; |