Sha256: f01248e0ac6486d14aba976aa39c1ca897b32b8c63dd95aff95bba3d8ec9f8cd

Contents?: true

Size: 1.97 KB

Versions: 43

Compression:

Stored size: 1.97 KB

Contents

module Fog
  module Parsers
    module AWS
      module RDS
        class DescribeOrderableDBInstanceOptions < Fog::Parsers::Base
          def reset
            @response = { 'DescribeOrderableDBInstanceOptionsResult' => {'OrderableDBInstanceOptions' => []}, 'ResponseMetadata' => {} }
            @db_instance_option = {}
            @db_instance_options = []
          end

          def start_element(name, attrs = [])
            case name
            when 'AvailabilityZones' then @availability_zones = []
            when 'AvailabilityZone' then @availability_zone = {}
            end
            super
          end

          def end_element(name)
            case name
            when 'MultiAZCapable', 'ReadReplicaCapable', 'Vpc', 'SupportsIops',
                 'SupportsEnhancedMonitoring', 'SupportsIAMDatabaseAuthentication',
                 'SupportsPerformanceInsights', 'SupportsStorageEncryption' then @db_instance_option[name] = to_boolean(value)
            when 'Engine', 'LicenseModel', 'EngineVersion', 'DBInstanceClass', 'StorageType' then @db_instance_option[name] = value
            when 'AvailabilityZones' then @db_instance_option[name] = @availability_zones
            when 'AvailabilityZone' then @availability_zones << @availability_zone unless @availability_zone.empty?
            when 'Name' then @availability_zone[name] = value
            when 'OrderableDBInstanceOption'
              @db_instance_options << @db_instance_option
              @db_instance_option = {}
            when 'OrderableDBInstanceOptions'
              @response['DescribeOrderableDBInstanceOptionsResult']['OrderableDBInstanceOptions'] = @db_instance_options
            when 'Marker' then @response['DescribeOrderableDBInstanceOptionsResult'][name] = value
            when 'RequestId' then @response['ResponseMetadata'][name] = value
            end
          end

          def to_boolean(v)
            (v =~ /\A\s*(true|yes|1|y)\s*$/i) == 0
          end
        end
      end
    end
  end
end

Version data entries

43 entries across 41 versions & 2 rubygems

Version Path
fog-aws-3.29.0 lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb
fog-aws-3.28.0 lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb
fog-aws-3.27.0 lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb
fog-aws-3.26.0 lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb
fog-aws-3.25.0 lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb
fog-aws-3.24.0 lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb
fog-aws-3.23.0 lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb
fog-aws-3.22.0 lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb
fog-aws-3.21.1 lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb
fog-aws-3.21.0 lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb
fog-aws-3.20.0 lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb
fog-aws-3.19.0 lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb
fog-aws-3.18.0 lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb
fog-aws-3.17.0 lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb
fog-aws-3.16.0 lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb
fog-aws-3.15.0 lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb
fog-aws-3.14.0 lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb
fog-aws-3.13.0 lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb
fog-aws-3.12.0 lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb
fog-aws-3.11.0 lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb