Sha256: 37e27762c714a10c71cad8ad26c66af4959d378595f0eea559f24c0429df8b63

Contents?: true

Size: 1.63 KB

Versions: 37

Compression:

Stored size: 1.63 KB

Contents

module Fog
  module Parsers
    module AWS
      module Storage
        class GetBucketNotification < Fog::Parsers::Base
          def reset
            @func = {}
            @queue = {}
            @topic = {}
            @response = {
              'Topics' => [],
              'Queues' => [],
              'CloudFunctions' => []
            }
          end

          def start_element(name, attrs = [])
            super
            case name
            when 'TopicConfiguration'
              @configuration = 'topic'
            when 'QueueConfiguration'
              @configuration = 'queue'
            when 'CloudFunctionConfiguration'
              @configuration = 'func'
            end
          end

          def end_element(name)
            case @configuration
            when 'topic'
              case name
              when 'Id', 'Event', 'Topic'
                @topic[name] = value
              when 'TopicConfiguration'
                @response['Topics'] << @topic
                @topic = {}
              end
            when 'queue'
              case name
              when 'Id', 'Queue', 'Event'
                @queue[name] = value
              when 'QueueConfiguration'
                @response['Queues'] << @queue
                @queue = {}
              end
            when 'func'
              case name
              when 'Id', 'CloudFunction', 'InvocationRule', 'Event'
                @func[name] = value
              when 'CloudFunctionConfiguration'
                @response['CloudFunctions'] << @func
                @func = {}
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

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