Sha256: a4984624e867bbb02c1303dca5b589f48de0196616752ed0edcb56951bf1adeb

Contents?: true

Size: 1.79 KB

Versions: 98

Compression:

Stored size: 1.79 KB

Contents

module Fog
  module Parsers
    module Redshift
      module AWS
        class PurchaseReservedNodeOffering < Fog::Parsers::Base
          # :reserved_node_id - (String)
          # :reserved_node_offering_id - (String)
          # :node_type - (String)
          # :start_time - (Time)
          # :duration - (Integer)
          # :fixed_price - (Numeric)
          # :usage_price - (Numeric)
          # :currency_code - (String)
          # :node_count - (Integer)
          # :state - (String)
          # :offering_type - (String)
          # :recurring_charges - (Array)
          #   :recurring_charge_amount - (Numeric)
          #   :recurring_charge_frequency - (String)
          def reset
            @response = { 'RecurringCharges' => [] }
          end

          def start_element(name, attrs = [])
            super
            case name
            when 'RecurringCharges'
              @recurring_charge = {}
            end
          end

          def end_element(name)
            super
            case name
            when 'ReservedNodeId', 'ReservedNodeOfferingId', 'NodeType', 'CurrencyCode', 'State', 'OfferingType'
              @response[name] = value
            when 'Duration', 'NodeCount'
              @response[name] = value.to_i
            when 'FixedPrice', 'UsagePrice'
              @response[name] = value.to_f
            when 'StartTime'
              @response[name] = Time.parse(value)
            when 'RecurringChargeAmount'
              @recurring_charge[name] = value.to_f
            when 'RecurringChargeFrequency'
              @recurring_charge[name] = value
            when 'RecurringCharge'
              @response['RecurringCharges'] << {name => @recurring_charge}
              @recurring_charge = {}
            end
          end
        end
      end
    end
  end
end

Version data entries

98 entries across 96 versions & 6 rubygems

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