1
0
Fork 0
mirror of https://github.com/fog/fog-aws.git synced 2022-11-09 13:50:52 -05:00
fog--fog-aws/lib/fog/aws/parsers/kms/list_keys.rb
Josh Lane f402dce5aa kms service
* list, describe, and create keys
2015-05-12 13:50:55 -07:00

38 lines
864 B
Ruby

module Fog
module Parsers
module AWS
module KMS
class ListKeys < Fog::Parsers::Base
def reset
@response = { 'Keys' => [] }
end
def start_element(name, attrs = [])
super
case name
when 'Keys'
@keys = []
when 'member'
@key = {}
end
end
def end_element(name)
case name
when 'KeyId', 'KeyArn'
@key[name] = value
when 'member'
@keys << @key
when 'Keys'
@response['Keys'] = @keys
when 'Truncated'
@response['Truncated'] = (value == 'true')
when 'NextMarker'
@response['Marker'] = value
end
end
end
end
end
end
end