Sha256: 0f6927b4d9a3fc6f4c05033d88a8b01fc1361bcd3e3342acaea4a7a8534ea9cd

Contents?: true

Size: 1.35 KB

Versions: 98

Compression:

Stored size: 1.35 KB

Contents

module Fog
  module Parsers
    module AWS
      module IAM
        class GetGroup < Fog::Parsers::Base
        # http://docs.amazonwebservices.com/IAM/latest/APIReference/index.html?API_GetGroup.html

          def reset
            @user = {}
            @response = { 'Group' => {}, 'Users' => [] }
          end

          def start_element(name, attrs = [])
            super
            case name
            when 'Group'
              @in_group = true
            when 'Users'
              @in_users = true
            end
          end

          def end_element(name)
            case name
            when 'Arn', 'Path'
              if @in_group
                @response['Group'][name] = value
              elsif @in_users
                @user[name] = value
              end
            when 'Group'
              @in_group = false
            when 'GroupName', 'GroupId'
              @response['Group'][name] = value
            when 'Users'
              @in_users = false
            when 'UserId', 'UserName'
              @user[name] = value
            when 'member'
              @response['Users'] << @user
              @user = {}
            when 'IsTruncated'
              response[name] = (value == 'true')
            when 'Marker', 'RequestId'
              @response[name] = value
            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/iam/get_group.rb
fog-aws-3.29.0 lib/fog/aws/parsers/iam/get_group.rb
fog-aws-3.28.0 lib/fog/aws/parsers/iam/get_group.rb
fog-aws-3.27.0 lib/fog/aws/parsers/iam/get_group.rb
fog-aws-3.26.0 lib/fog/aws/parsers/iam/get_group.rb
fog-aws-3.25.0 lib/fog/aws/parsers/iam/get_group.rb
fog-aws-3.24.0 lib/fog/aws/parsers/iam/get_group.rb
fog-aws-3.23.0 lib/fog/aws/parsers/iam/get_group.rb
fog-aws-3.22.0 lib/fog/aws/parsers/iam/get_group.rb
fog-aws-3.21.1 lib/fog/aws/parsers/iam/get_group.rb
fog-aws-3.21.0 lib/fog/aws/parsers/iam/get_group.rb
fog-aws-3.20.0 lib/fog/aws/parsers/iam/get_group.rb
fog-aws-3.19.0 lib/fog/aws/parsers/iam/get_group.rb
fog-aws-3.18.0 lib/fog/aws/parsers/iam/get_group.rb
fog-aws-3.17.0 lib/fog/aws/parsers/iam/get_group.rb
fog-aws-3.16.0 lib/fog/aws/parsers/iam/get_group.rb
fog-aws-3.15.0 lib/fog/aws/parsers/iam/get_group.rb
fog-aws-3.14.0 lib/fog/aws/parsers/iam/get_group.rb
fog-aws-3.13.0 lib/fog/aws/parsers/iam/get_group.rb
fog-aws-3.12.0 lib/fog/aws/parsers/iam/get_group.rb