1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[core] update parser to better handle whitespace

This commit is contained in:
geemus 2011-05-12 13:15:13 -07:00
parent 37499d7c65
commit b452aa679d
181 changed files with 598 additions and 597 deletions

View file

@ -16,6 +16,7 @@ class Parser < Nokogiri::XML::SAX::Document
end end
def characters(string) def characters(string)
@value ||= ''
@value << string.strip @value << string.strip
end end
@ -29,10 +30,14 @@ class Parser < Nokogiri::XML::SAX::Document
@response[:items] << @item @response[:items] << @item
@item = {} @item = {}
when 'key' when 'key'
@item[:key] = @value @item[:key] = value
end end
end end
def value
@value.dup
end
end end
data = <<-DATA data = <<-DATA
@ -43,18 +48,22 @@ data = <<-DATA
</items> </items>
DATA DATA
COUNT = 100 COUNT = 10_000
Benchmark.bmbm(25) do |bench| Benchmark.bmbm(25) do |bench|
bench.report('parse') do bench.report('parse') do
parser = Parser.new COUNT.times do
Nokogiri::XML::SAX::Parser.new(parser).parse(data) parser = Parser.new
parser.response Nokogiri::XML::SAX::Parser.new(parser).parse(data)
parser.response
end
end end
bench.report('push') do bench.report('push') do
parser = Parser.new COUNT.times do
Nokogiri::XML::SAX::PushParser.new(parser).write(data, true) parser = Parser.new
parser.response Nokogiri::XML::SAX::PushParser.new(parser).write(data, true)
parser.response
end
end end
end end

View file

@ -8,7 +8,7 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'RequestId', 'StackId' when 'RequestId', 'StackId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -13,14 +13,14 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'EventId', 'LogicalResourceId', 'PhysicalResourceId', 'ResourceProperties', 'ResourceStatus', 'ResourceStatusReason', 'ResourceType', 'StackId', 'StackName' when 'EventId', 'LogicalResourceId', 'PhysicalResourceId', 'ResourceProperties', 'ResourceStatus', 'ResourceStatusReason', 'ResourceType', 'StackId', 'StackName'
@event[name] = @value @event[name] = value
when 'member' when 'member'
@response['StackEvents'] << @event @response['StackEvents'] << @event
@event = {} @event = {}
when 'RequestId' when 'RequestId'
@response[name] = @value @response[name] = value
when 'Timestamp' when 'Timestamp'
@event[name] = Time.parse(@value) @event[name] = Time.parse(value)
end end
end end

View file

@ -13,14 +13,14 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'StackId', 'StackName', 'LogicalResourceId', 'PhysicalResourceId', 'ResourceType', 'ResourceStatus' when 'StackId', 'StackName', 'LogicalResourceId', 'PhysicalResourceId', 'ResourceType', 'ResourceStatus'
@resource[name] = @value @resource[name] = value
when 'member' when 'member'
@response['StackResources'] << @resource @response['StackResources'] << @resource
@resource = {} @resource = {}
when 'RequestId' when 'RequestId'
@response[name] = @value @response[name] = value
when 'Timestamp' when 'Timestamp'
@resource[name] = Time.parse(@value) @resource[name] = Time.parse(value)
end end
end end

View file

@ -26,7 +26,7 @@ module Fog
if @in_outputs if @in_outputs
case name case name
when 'OutputKey', 'OutputValue' when 'OutputKey', 'OutputValue'
@output[name] = @value @output[name] = value
when 'member' when 'member'
@stack['Outputs'] << @output @stack['Outputs'] << @output
@output = {} @output = {}
@ -36,7 +36,7 @@ module Fog
elsif @in_parameters elsif @in_parameters
case name case name
when 'ParameterKey', 'ParameterValue' when 'ParameterKey', 'ParameterValue'
@parameter[name] = @value @parameter[name] = value
when 'member' when 'member'
@stack['Parameters'] << @parameter @stack['Parameters'] << @parameter
@parameter = {} @parameter = {}
@ -49,18 +49,18 @@ module Fog
@response['Stacks'] << @stack @response['Stacks'] << @stack
@stack = { 'Outputs' => [], 'Parameters' => [] } @stack = { 'Outputs' => [], 'Parameters' => [] }
when 'RequestId' when 'RequestId'
@response[name] = @value @response[name] = value
when 'CreationTime' when 'CreationTime'
@stack[name] = Time.parse(@value) @stack[name] = Time.parse(value)
when 'DisableRollback' when 'DisableRollback'
case @value case value
when 'false' when 'false'
@stack[name] = false @stack[name] = false
when 'true' when 'true'
@stack[name] = true @stack[name] = true
end end
when 'StackName', 'StackId', 'StackStatus' when 'StackName', 'StackId', 'StackStatus'
@stack[name] = @value @stack[name] = value
end end
end end
end end

View file

@ -8,7 +8,7 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'RequestId', 'TemplateBody' when 'RequestId', 'TemplateBody'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -21,20 +21,20 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'DefaultValue', 'ParameterKey' when 'DefaultValue', 'ParameterKey'
@parameter[name] = @value @parameter[name] = value
when 'Description' when 'Description'
if @in_parameters if @in_parameters
@parameter[name] = @value @parameter[name] = value
else else
@response[name] = @value @response[name] = value
end end
when 'RequestId' when 'RequestId'
@response[name] = @value @response[name] = value
when 'member' when 'member'
@response['Parameters'] << @parameter @response['Parameters'] << @parameter
@parameter = {} @parameter = {}
when 'NoEcho' when 'NoEcho'
case @value case value
when 'false' when 'false'
@parameter[name] = false @parameter[name] = false
when 'true' when 'true'

View file

@ -17,15 +17,15 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'Target' when 'Target'
@health_check[name] = @value @health_check[name] = value
when 'Interval', 'Timeout', 'UnhealthyThreshold', 'HealthyThreshold' when 'Interval', 'Timeout', 'UnhealthyThreshold', 'HealthyThreshold'
@health_check[name] = @value.to_i @health_check[name] = value.to_i
when 'HealthCheck' when 'HealthCheck'
@response['ConfigureHealthCheckResult'][name] = @health_check @response['ConfigureHealthCheckResult'][name] = @health_check
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
end end
end end

View file

@ -12,9 +12,9 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'DNSName' when 'DNSName'
@response['CreateLoadBalancerResult'][name] = @value @response['CreateLoadBalancerResult'][name] = value
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
end end
end end

View file

@ -12,7 +12,7 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
end end
end end

View file

@ -12,9 +12,9 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'InstanceId' when 'InstanceId'
@response['DeregisterInstancesFromLoadBalancerResult']['Instances'] << {name => @value} @response['DeregisterInstancesFromLoadBalancerResult']['Instances'] << {name => value}
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
end end
end end

View file

@ -13,12 +13,12 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'Description', 'State', 'InstanceId', 'ReasonCode' when 'Description', 'State', 'InstanceId', 'ReasonCode'
@instance_state[name] = @value @instance_state[name] = value
when 'member' when 'member'
@response['DescribeInstanceHealthResult']['InstanceStates'] << @instance_state @response['DescribeInstanceHealthResult']['InstanceStates'] << @instance_state
@instance_state = {} @instance_state = {}
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
end end
end end

View file

@ -49,9 +49,9 @@ module Fog
case name case name
when 'member' when 'member'
if @in_policy_names if @in_policy_names
@listener_description['PolicyNames'] << @value @listener_description['PolicyNames'] << value
elsif @in_availability_zones elsif @in_availability_zones
@load_balancer['AvailabilityZones'] << @value @load_balancer['AvailabilityZones'] << value
elsif @in_listeners elsif @in_listeners
@load_balancer['ListenerDescriptions'] << @listener_description @load_balancer['ListenerDescriptions'] << @listener_description
reset_listener_description reset_listener_description
@ -67,23 +67,23 @@ module Fog
end end
when 'LoadBalancerName', 'DNSName' when 'LoadBalancerName', 'DNSName'
@load_balancer[name] = @value @load_balancer[name] = value
when 'CreatedTime' when 'CreatedTime'
@load_balancer[name] = Time.parse(@value) @load_balancer[name] = Time.parse(value)
when 'ListenerDescriptions' when 'ListenerDescriptions'
@in_listeners = false @in_listeners = false
when 'PolicyNames' when 'PolicyNames'
@in_policy_names = false @in_policy_names = false
when 'Protocol' when 'Protocol'
@listener_description['Listener'][name] = @value @listener_description['Listener'][name] = value
when 'LoadBalancerPort', 'InstancePort' when 'LoadBalancerPort', 'InstancePort'
@listener_description['Listener'][name] = @value.to_i @listener_description['Listener'][name] = value.to_i
when 'Instances' when 'Instances'
@in_instances = false @in_instances = false
when 'InstanceId' when 'InstanceId'
@load_balancer['Instances'] << @value @load_balancer['Instances'] << value
when 'AvailabilityZones' when 'AvailabilityZones'
@in_availability_zones = false @in_availability_zones = false
@ -96,17 +96,17 @@ module Fog
@in_lb_cookies = false @in_lb_cookies = false
when 'Interval', 'HealthyThreshold', 'Timeout', 'UnhealthyThreshold' when 'Interval', 'HealthyThreshold', 'Timeout', 'UnhealthyThreshold'
@load_balancer['HealthCheck'][name] = @value.to_i @load_balancer['HealthCheck'][name] = value.to_i
when 'Target' when 'Target'
@load_balancer['HealthCheck'][name] = @value @load_balancer['HealthCheck'][name] = value
when 'PolicyName', 'CookieName' when 'PolicyName', 'CookieName'
@policy[name] = @value @policy[name] = value
when 'CookieExpirationPeriod' when 'CookieExpirationPeriod'
@policy[name] = @value.to_i @policy[name] = value.to_i
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
when 'DescribeLoadBalancersResponse' when 'DescribeLoadBalancersResponse'
@response['DescribeLoadBalancersResult'] = @results @response['DescribeLoadBalancersResult'] = @results

View file

@ -12,9 +12,9 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'member' when 'member'
@response['DisableAvailabilityZonesForLoadBalancerResult']['AvailabilityZones'] << @value @response['DisableAvailabilityZonesForLoadBalancerResult']['AvailabilityZones'] << value
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
end end
end end

View file

@ -16,7 +16,7 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
end end
end end

View file

@ -12,9 +12,9 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'member' when 'member'
@response['EnableAvailabilityZonesForLoadBalancerResult']['AvailabilityZones'] << @value @response['EnableAvailabilityZonesForLoadBalancerResult']['AvailabilityZones'] << value
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
end end
end end

View file

@ -12,9 +12,9 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'InstanceId' when 'InstanceId'
@response['RegisterInstancesWithLoadBalancerResult']['Instances'] << {name => @value} @response['RegisterInstancesWithLoadBalancerResult']['Instances'] << {name => value}
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
end end
end end

View file

@ -8,7 +8,7 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'RequestId' when 'RequestId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -12,9 +12,9 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'AccessKeyId', 'UserName', 'SecretAccessKey', 'Status' when 'AccessKeyId', 'UserName', 'SecretAccessKey', 'Status'
@response['AccessKey'][name] = @value @response['AccessKey'][name] = value
when 'RequestId' when 'RequestId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -12,9 +12,9 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'Arn', 'GroupId', 'GroupName', 'Path' when 'Arn', 'GroupId', 'GroupName', 'Path'
@response['Group'][name] = @value @response['Group'][name] = value
when 'RequestId' when 'RequestId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -12,9 +12,9 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'Arn', 'UserId', 'UserName', 'Path' when 'Arn', 'UserId', 'UserName', 'Path'
@response['User'][name] = @value @response['User'][name] = value
when 'RequestId' when 'RequestId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -25,25 +25,25 @@ module Fog
case name case name
when 'Arn' when 'Arn'
if @in_group if @in_group
@response['Group'][name] = @value @response['Group'][name] = value
elsif @in_users elsif @in_users
@user[name] = @value @user[name] = value
end end
when 'Group' when 'Group'
@in_group = false @in_group = false
when 'GroupName', 'GroupId' when 'GroupName', 'GroupId'
@response['Group'][name] = @value @response['Group'][name] = value
when 'Users' when 'Users'
@in_users = false @in_users = false
when 'UserId', 'UserName', 'Path' when 'UserId', 'UserName', 'Path'
@user[name] = @value @user[name] = value
when 'member' when 'member'
@response['Users'] << @user @response['Users'] << @user
@user = {} @user = {}
when 'IsTruncated' when 'IsTruncated'
response[name] = (@value == 'true') response[name] = (value == 'true')
when 'Marker', 'RequestId' when 'Marker', 'RequestId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -13,9 +13,9 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'Arn', 'UserId', 'UserName', 'Path' when 'Arn', 'UserId', 'UserName', 'Path'
@response['User'][name] = @value @response['User'][name] = value
when 'RequestId' when 'RequestId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -13,9 +13,9 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'UserName', 'PolicyName', 'PolicyDocument' when 'UserName', 'PolicyName', 'PolicyDocument'
@response[name] = @value @response[name] = value
when 'RequestId' when 'RequestId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -13,14 +13,14 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'AccessKeyId', 'Status', 'Username' when 'AccessKeyId', 'Status', 'Username'
@access_key[name] = @value @access_key[name] = value
when 'member' when 'member'
@response['AccessKeys'] << @access_key @response['AccessKeys'] << @access_key
@access_key = {} @access_key = {}
when 'IsTruncated' when 'IsTruncated'
response[name] = (@value == 'true') response[name] = (value == 'true')
when 'Marker', 'RequestId' when 'Marker', 'RequestId'
response[name] = @value response[name] = value
end end
end end

View file

@ -13,14 +13,14 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'Arn', 'GroupId', 'GroupName', 'Path' when 'Arn', 'GroupId', 'GroupName', 'Path'
@group[name] = @value @group[name] = value
when 'member' when 'member'
@response['Groups'] << @group @response['Groups'] << @group
@group = {} @group = {}
when 'IsTruncated' when 'IsTruncated'
response[name] = (@value == 'true') response[name] = (value == 'true')
when 'Marker', 'RequestId' when 'Marker', 'RequestId'
response[name] = @value response[name] = value
end end
end end

View file

@ -13,14 +13,14 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'Path', 'GroupName', 'GroupId', 'Arn' when 'Path', 'GroupName', 'GroupId', 'Arn'
@group_for_user[name] = @value @group_for_user[name] = value
when 'member' when 'member'
@response['GroupsForUser'] << @group_for_user @response['GroupsForUser'] << @group_for_user
@group_for_user = {} @group_for_user = {}
when 'IsTruncated' when 'IsTruncated'
response[name] = (@value == 'true') response[name] = (value == 'true')
when 'Marker', 'RequestId' when 'Marker', 'RequestId'
response[name] = @value response[name] = value
end end
end end

View file

@ -12,11 +12,11 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'member' when 'member'
@response['PolicyNames'] << @value @response['PolicyNames'] << value
when 'IsTruncated' when 'IsTruncated'
response[name] = (@value == 'true') response[name] = (value == 'true')
when 'Marker', 'RequestId' when 'Marker', 'RequestId'
response[name] = @value response[name] = value
end end
end end

View file

@ -17,16 +17,16 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'Arn', 'Path', 'ServerCertificateId', 'ServerCertificateName' when 'Arn', 'Path', 'ServerCertificateId', 'ServerCertificateName'
@certificate[name] = @value @certificate[name] = value
when 'UploadDate' when 'UploadDate'
@certificate[name] = Time.parse(@value) @certificate[name] = Time.parse(value)
when 'member' when 'member'
@response['Certificates'] << @certificate @response['Certificates'] << @certificate
reset_certificate reset_certificate
when 'IsTrunctated' when 'IsTrunctated'
@response[name] = !!@value @response[name] = !!value
when 'Marker' when 'Marker'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -13,14 +13,14 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'UserName', 'CertificateId', 'CertificateBody', 'Status' when 'UserName', 'CertificateId', 'CertificateBody', 'Status'
@signing_certificate[name] = @value @signing_certificate[name] = value
when 'member' when 'member'
@response['SigningCertificates'] << @signing_certificate @response['SigningCertificates'] << @signing_certificate
@signing_certificate = {} @signing_certificate = {}
when 'IsTruncated' when 'IsTruncated'
response[name] = (@value == 'true') response[name] = (value == 'true')
when 'Marker', 'RequestId' when 'Marker', 'RequestId'
response[name] = @value response[name] = value
end end
end end

View file

@ -13,14 +13,14 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'Arn', 'UserId', 'UserName', 'Path' when 'Arn', 'UserId', 'UserName', 'Path'
@user[name] = @value @user[name] = value
when 'member' when 'member'
@response['Users'] << @user @response['Users'] << @user
@user = {} @user = {}
when 'IsTruncated' when 'IsTruncated'
response[name] = (@value == 'true') response[name] = (value == 'true')
when 'Marker', 'RequestId' when 'Marker', 'RequestId'
response[name] = @value response[name] = value
end end
end end

View file

@ -12,11 +12,11 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'UserName' when 'UserName'
@response['LoginProfile']['UserName'] = @value @response['LoginProfile']['UserName'] = value
when 'CreateDate' when 'CreateDate'
@response['LoginProfile']['CreateDate'] = Time.parse(@value) @response['LoginProfile']['CreateDate'] = Time.parse(value)
when 'RequestId' when 'RequestId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -12,9 +12,9 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'Arn', 'GroupId', 'GroupName', 'Path' when 'Arn', 'GroupId', 'GroupName', 'Path'
@response['Group'][name] = @value @response['Group'][name] = value
when 'RequestId' when 'RequestId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -13,9 +13,9 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'Arn', 'UserId', 'UserName', 'Path' when 'Arn', 'UserId', 'UserName', 'Path'
@response['User'][name] = @value @response['User'][name] = value
when 'RequestId' when 'RequestId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -12,11 +12,11 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'Arn', 'Path', 'ServerCertificateId', 'ServerCertificateName' when 'Arn', 'Path', 'ServerCertificateId', 'ServerCertificateName'
@response['Certificate'][name] = @value @response['Certificate'][name] = value
when 'UploadDate' when 'UploadDate'
@response['Certificate'][name] = Time.parse(@value) @response['Certificate'][name] = Time.parse(value)
when 'RequestId' when 'RequestId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -12,9 +12,9 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'CertificateId', 'UserName', 'CertificateBody', 'Status' when 'CertificateId', 'UserName', 'CertificateBody', 'Status'
@response['Certificate'][name] = @value @response['Certificate'][name] = value
when 'RequestId' when 'RequestId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -22,7 +22,7 @@ module Fog
@response['AuthorizeDBSecurityGroupIngressResult']['DBSecurityGroup'] = @security_group @response['AuthorizeDBSecurityGroupIngressResult']['DBSecurityGroup'] = @security_group
@security_group = fresh_security_group @security_group = fresh_security_group
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
else else
super super
end end

View file

@ -22,7 +22,7 @@ module Fog
@response['CreateDBInstanceResult']['DBInstance'] = @db_instance @response['CreateDBInstanceResult']['DBInstance'] = @db_instance
@db_instance = fresh_instance @db_instance = fresh_instance
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
else else
super super
end end

View file

@ -22,7 +22,7 @@ module Fog
@response['CreateDBInstanceReadReplicaResult']['DBInstance'] = @db_instance @response['CreateDBInstanceReadReplicaResult']['DBInstance'] = @db_instance
@db_instance = fresh_instance @db_instance = fresh_instance
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
else else
super super
end end

View file

@ -17,15 +17,15 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'DBParameterGroupFamily' when 'DBParameterGroupFamily'
@db_parameter_group['DBParameterGroupFamily'] = @value @db_parameter_group['DBParameterGroupFamily'] = value
when 'Description' when 'Description'
@db_parameter_group['Description'] = @value @db_parameter_group['Description'] = value
when 'DBParameterGroupName' when 'DBParameterGroupName'
@db_parameter_group['DBParameterGroupName'] = @value @db_parameter_group['DBParameterGroupName'] = value
when 'DBParameterGroup' when 'DBParameterGroup'
@response['CreateDBParameterGroupResult']['DBParameterGroup']= @db_parameter_group @response['CreateDBParameterGroupResult']['DBParameterGroup']= @db_parameter_group
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
end end
end end
end end

View file

@ -22,7 +22,7 @@ module Fog
@response['CreateDBSecurityGroupResult']['DBSecurityGroup'] = @security_group @response['CreateDBSecurityGroupResult']['DBSecurityGroup'] = @security_group
@security_group = fresh_security_group @security_group = fresh_security_group
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
else else
super super
end end

View file

@ -21,7 +21,7 @@ module Fog
@response['CreateDBSnapshotResult']['DBSnapshot'] = @db_snapshot @response['CreateDBSnapshotResult']['DBSnapshot'] = @db_snapshot
@db_snapshot = fresh_snapshot @db_snapshot = fresh_snapshot
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
else else
super super
end end

View file

@ -41,14 +41,14 @@ module Fog
case name case name
when 'LatestRestorableTime', 'InstanceCreateTime' when 'LatestRestorableTime', 'InstanceCreateTime'
@db_instance[name] = Time.parse @value @db_instance[name] = Time.parse value
when 'Engine', when 'Engine',
'DBInstanceStatus', 'DBInstanceIdentifier', 'EngineVersion', 'DBInstanceStatus', 'DBInstanceIdentifier', 'EngineVersion',
'PreferredBackupWindow', 'PreferredMaintenanceWindow', 'PreferredBackupWindow', 'PreferredMaintenanceWindow',
'AvailabilityZone', 'MasterUsername', 'DBName' 'AvailabilityZone', 'MasterUsername', 'DBName'
@db_instance[name] = @value @db_instance[name] = value
when 'MultiAZ', 'AutoMinorVersionUpgrade' when 'MultiAZ', 'AutoMinorVersionUpgrade'
if @value == 'false' if value == 'false'
@db_instance[name] = false @db_instance[name] = false
else else
@db_instance[name] = true @db_instance[name] = true
@ -61,27 +61,27 @@ module Fog
@db_parameter_group = {} @db_parameter_group = {}
when 'ParameterApplyStatus', 'DBParameterGroupName' when 'ParameterApplyStatus', 'DBParameterGroupName'
if @in_db_parameter_groups if @in_db_parameter_groups
@db_parameter_group[name] = @value @db_parameter_group[name] = value
end end
when 'BackupRetentionPeriod' when 'BackupRetentionPeriod'
if @in_pending_modified_values if @in_pending_modified_values
@pending_modified_values[name] = @value.to_i @pending_modified_values[name] = value.to_i
else else
@db_instance[name] = @value.to_i @db_instance[name] = value.to_i
end end
when 'DBInstanceClass', 'EngineVersion', 'MasterUserPassword', 'MultiAZ' when 'DBInstanceClass', 'EngineVersion', 'MasterUserPassword', 'MultiAZ'
if @in_pending_modified_values if @in_pending_modified_values
@pending_modified_values[name] = @value @pending_modified_values[name] = value
else else
@db_instance[name] = @value @db_instance[name] = value
end end
when 'DBSecurityGroups' when 'DBSecurityGroups'
@in_db_security_groups = false @in_db_security_groups = false
@db_instance['DBSecurityGroups'] = @db_security_groups @db_instance['DBSecurityGroups'] = @db_security_groups
when 'Status', 'DBSecurityGroupName' when 'Status', 'DBSecurityGroupName'
if @in_db_security_groups if @in_db_security_groups
@db_security_group[name]=@value @db_security_group[name]=value
end end
when 'DBSecurityGroup' when 'DBSecurityGroup'
@db_security_groups << @db_security_group @db_security_groups << @db_security_group
@ -89,17 +89,17 @@ module Fog
when 'AllocatedStorage' when 'AllocatedStorage'
if @in_pending_modified_values if @in_pending_modified_values
@pending_modified_values[name] = @value.to_i @pending_modified_values[name] = value.to_i
else else
@db_instance[name] = @value.to_i @db_instance[name] = value.to_i
end end
when 'Address' when 'Address'
@endpoint[name] = @value @endpoint[name] = value
when 'Port' when 'Port'
if @in_pending_modified_values if @in_pending_modified_values
@pending_modified_values[name] = @value.to_i @pending_modified_values[name] = value.to_i
elsif @in_endpoint elsif @in_endpoint
@endpoint[name] = @value.to_i @endpoint[name] = value.to_i
end end
when 'PendingModifiedValues' when 'PendingModifiedValues'
@ -109,9 +109,9 @@ module Fog
@in_endpoint = false @in_endpoint = false
@db_instance['Endpoint'] = @endpoint @db_instance['Endpoint'] = @endpoint
when 'ReadReplicaDBInstanceIdentifier' when 'ReadReplicaDBInstanceIdentifier'
@db_instance['ReadReplicaDBInstanceIdentifiers'] << @value @db_instance['ReadReplicaDBInstanceIdentifiers'] << value
when 'ReadReplicaSourceDBInstanceIdentifier' when 'ReadReplicaSourceDBInstanceIdentifier'
@db_instance['ReadReplicaSourceDBInstanceIdentifier'] = @value @db_instance['ReadReplicaSourceDBInstanceIdentifier'] = value
when 'DBInstance' when 'DBInstance'
@db_instance = fresh_instance @db_instance = fresh_instance
end end

View file

@ -23,7 +23,7 @@ module Fog
@response['DeleteDBInstanceResult']['DBInstance'] = @db_instance @response['DeleteDBInstanceResult']['DBInstance'] = @db_instance
@db_instance = fresh_instance @db_instance = fresh_instance
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
else else
super super
end end

View file

@ -17,7 +17,7 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
end end
end end
end end

View file

@ -18,7 +18,7 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
else else
super super
end end

View file

@ -19,7 +19,7 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
when 'DBSnapshot' when 'DBSnapshot'
@response['DeleteDBSnapshotResult']['DBSnapshot'] = @db_snapshot @response['DeleteDBSnapshotResult']['DBSnapshot'] = @db_snapshot
@db_snapshot = fresh_snapshot @db_snapshot = fresh_snapshot

View file

@ -22,9 +22,9 @@ module Fog
@response['DescribeDBInstancesResult']['DBInstances'] << @db_instance @response['DescribeDBInstancesResult']['DBInstances'] << @db_instance
@db_instance = fresh_instance @db_instance = fresh_instance
when 'Marker' when 'Marker'
@response['DescribeDBInstancesResult']['Marker'] = @value @response['DescribeDBInstancesResult']['Marker'] = value
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
else else
super super
end end

View file

@ -16,16 +16,16 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'DBParameterGroupFamily' then @db_parameter_group['DBParameterGroupFamily'] = @value when 'DBParameterGroupFamily' then @db_parameter_group['DBParameterGroupFamily'] = value
when 'Description' then @db_parameter_group['Description'] = @value when 'Description' then @db_parameter_group['Description'] = value
when 'DBParameterGroupName' then @db_parameter_group['DBParameterGroupName'] = @value when 'DBParameterGroupName' then @db_parameter_group['DBParameterGroupName'] = value
when 'DBParameterGroup' then when 'DBParameterGroup' then
@response['DescribeDBParameterGroupsResult']['DBParameterGroups'] << @db_parameter_group @response['DescribeDBParameterGroupsResult']['DBParameterGroups'] << @db_parameter_group
@db_parameter_group = {} @db_parameter_group = {}
when 'Marker' when 'Marker'
@response['DescribeDBParameterGroupsResult']['Marker'] = @value @response['DescribeDBParameterGroupsResult']['Marker'] = value
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
end end
end end

View file

@ -17,24 +17,24 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'ParameterValue' then @parameter['ParameterValue'] = @value when 'ParameterValue' then @parameter['ParameterValue'] = value
when 'DataType' then @parameter['DataType'] = @value when 'DataType' then @parameter['DataType'] = value
when 'AllowedValues' then @parameter['AllowedValues'] = @value when 'AllowedValues' then @parameter['AllowedValues'] = value
when 'Source' then @parameter['Source'] = @value when 'Source' then @parameter['Source'] = value
when 'IsModifiable' then when 'IsModifiable' then
@parameter['IsModifiable'] = @value == 'true' ? true : false @parameter['IsModifiable'] = value == 'true' ? true : false
when 'Description' then @parameter['Description'] = @value when 'Description' then @parameter['Description'] = value
when 'ApplyType' then @parameter['ApplyType'] = @value when 'ApplyType' then @parameter['ApplyType'] = value
when 'ParameterName' then @parameter['ParameterName'] = @value when 'ParameterName' then @parameter['ParameterName'] = value
when 'Parameter' when 'Parameter'
@parameters << @parameter @parameters << @parameter
@parameter = {} @parameter = {}
when 'Marker' when 'Marker'
@response['DescribeDBParametersResult']['Marker'] = @value @response['DescribeDBParametersResult']['Marker'] = value
when 'Parameters' when 'Parameters'
@response['DescribeDBParametersResult']['Parameters'] = @parameters @response['DescribeDBParametersResult']['Parameters'] = @parameters
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
end end
end end
end end

View file

@ -22,9 +22,9 @@ module Fog
@response['DescribeDBSecurityGroupsResult']['DBSecurityGroups'] << @security_group @response['DescribeDBSecurityGroupsResult']['DBSecurityGroups'] << @security_group
@security_group = fresh_security_group @security_group = fresh_security_group
when 'Marker' when 'Marker'
@response['DescribeDBSecurityGroupsResult']['Marker'] = @value @response['DescribeDBSecurityGroupsResult']['Marker'] = value
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
else else
super super
end end

View file

@ -22,9 +22,9 @@ module Fog
@response['DescribeDBSnapshotsResult']['DBSnapshots'] << @db_snapshot @response['DescribeDBSnapshotsResult']['DBSnapshots'] << @db_snapshot
@db_snapshot = fresh_snapshot @db_snapshot = fresh_snapshot
when 'Marker' when 'Marker'
@response['DescribeDBSnapshotsResult']['Marker'] = @value @response['DescribeDBSnapshotsResult']['Marker'] = value
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
else else
super super
end end

View file

@ -22,7 +22,7 @@ module Fog
@response['ModifyDBInstanceResult']['DBInstance'] = @db_instance @response['ModifyDBInstanceResult']['DBInstance'] = @db_instance
@db_instance = fresh_instance @db_instance = fresh_instance
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
else else
super super
end end

View file

@ -16,9 +16,9 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'DBParameterGroupName' when 'DBParameterGroupName'
@response['ModifyDBParameterGroupResult']['DBParameterGroupName'] = @value @response['ModifyDBParameterGroupResult']['DBParameterGroupName'] = value
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
end end
end end
end end

View file

@ -23,7 +23,7 @@ module Fog
@response['RebootDBInstanceResult']['DBInstance'] = @db_instance @response['RebootDBInstanceResult']['DBInstance'] = @db_instance
@db_instance = fresh_instance @db_instance = fresh_instance
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
else else
super super
end end

View file

@ -22,7 +22,7 @@ module Fog
@response['RestoreDBInstanceFromDBSnapshot']['DBInstance'] = @db_instance @response['RestoreDBInstanceFromDBSnapshot']['DBInstance'] = @db_instance
@db_instance = fresh_instance @db_instance = fresh_instance
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
else else
super super
end end

View file

@ -22,7 +22,7 @@ module Fog
@response['RestoreDBInstanceToPointInTime']['DBInstance'] = @db_instance @response['RestoreDBInstanceToPointInTime']['DBInstance'] = @db_instance
@db_instance = fresh_instance @db_instance = fresh_instance
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
else else
super super
end end

View file

@ -22,7 +22,7 @@ module Fog
@response['RevokeDBSecurityGroupIngressResult']['DBSecurityGroup'] = @security_group @response['RevokeDBSecurityGroupIngressResult']['DBSecurityGroup'] = @security_group
@security_group = fresh_security_group @security_group = fresh_security_group
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
else else
super super
end end

View file

@ -23,13 +23,13 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'DBSecurityGroupDescription' then @security_group['DBSecurityGroupDescription'] = @value when 'DBSecurityGroupDescription' then @security_group['DBSecurityGroupDescription'] = value
when 'DBSecurityGroupName' then @security_group['DBSecurityGroupName'] = @value when 'DBSecurityGroupName' then @security_group['DBSecurityGroupName'] = value
when 'OwnerId' then @security_group['OwnerId'] = @value when 'OwnerId' then @security_group['OwnerId'] = value
when 'EC2SecurityGroup', 'IPRange' when 'EC2SecurityGroup', 'IPRange'
@security_group["#{name}s"] << @ingress unless @ingress.empty? @security_group["#{name}s"] << @ingress unless @ingress.empty?
when 'EC2SecurityGroupName', 'EC2SecurityGroupOwnerId', 'CIDRIP', 'Status' when 'EC2SecurityGroupName', 'EC2SecurityGroupOwnerId', 'CIDRIP', 'Status'
@ingress[name] = @value @ingress[name] = value
end end
end end
end end

View file

@ -20,17 +20,17 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'AllocatedStorage' then @db_snapshot['AllocatedStorage'] = @value.to_i when 'AllocatedStorage' then @db_snapshot['AllocatedStorage'] = value.to_i
when 'AvailabilityZone' then @db_snapshot['AvailabilityZone'] = @value when 'AvailabilityZone' then @db_snapshot['AvailabilityZone'] = value
when 'DBInstanceIdentifier' then @db_snapshot['DBInstanceIdentifier'] = @value when 'DBInstanceIdentifier' then @db_snapshot['DBInstanceIdentifier'] = value
when 'DBSnapshotIdentifier' then @db_snapshot['DBSnapshotIdentifier'] = @value when 'DBSnapshotIdentifier' then @db_snapshot['DBSnapshotIdentifier'] = value
when 'Engine' then @db_snapshot['Engine'] = @value when 'Engine' then @db_snapshot['Engine'] = value
when 'EngineVersion' then @db_snapshot['EngineVersion'] = @value when 'EngineVersion' then @db_snapshot['EngineVersion'] = value
when 'InstanceCreateTime' then @db_snapshot['InstanceCreateTime'] = Time.parse @value when 'InstanceCreateTime' then @db_snapshot['InstanceCreateTime'] = Time.parse value
when 'MasterUsername' then @db_snapshot['MasterUsername'] = @value when 'MasterUsername' then @db_snapshot['MasterUsername'] = value
when 'Port' then @db_snapshot['Port'] = @value.to_i when 'Port' then @db_snapshot['Port'] = value.to_i
when 'SnapshotCreateTime' then @db_snapshot['SnapshotCreateTime'] = Time.parse @value when 'SnapshotCreateTime' then @db_snapshot['SnapshotCreateTime'] = Time.parse value
when 'Status' then @db_snapshot['Status'] = @value when 'Status' then @db_snapshot['Status'] = value
end end
end end
end end

View file

@ -12,7 +12,7 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
end end
end end

View file

@ -12,9 +12,9 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when "Max24HourSend", "MaxSendRate", "SentLast24Hours" when "Max24HourSend", "MaxSendRate", "SentLast24Hours"
@response[name] = @value @response[name] = value
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
end end
end end

View file

@ -13,12 +13,12 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when "Bounces", "Complaints", "DeliveryAttempts", "Rejects", "Timestamp" when "Bounces", "Complaints", "DeliveryAttempts", "Rejects", "Timestamp"
@send_data_point[name] = @value @send_data_point[name] = value
when 'member' when 'member'
@response['SendDataPoints'] << @send_data_point @response['SendDataPoints'] << @send_data_point
@send_data_point = {} @send_data_point = {}
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
end end
end end
end end

View file

@ -12,9 +12,9 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'member' when 'member'
@response['VerifiedEmailAddresses'] << @value @response['VerifiedEmailAddresses'] << value
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
end end
end end
end end

View file

@ -12,9 +12,9 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'MessageId' when 'MessageId'
@response[name] = @value @response[name] = value
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
end end
end end

View file

@ -12,9 +12,9 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'MessageId' when 'MessageId'
@response[name] = @value @response[name] = value
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
end end
end end

View file

@ -12,7 +12,7 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'RequestId' when 'RequestId'
@response['ResponseMetadata'][name] = @value @response['ResponseMetadata'][name] = value
end end
end end

View file

@ -13,9 +13,9 @@ module Fog
def end_element(name) def end_element(name)
case(name) case(name)
when 'BoxUsage' when 'BoxUsage'
response[name] = @value.to_f response[name] = value.to_f
when 'RequestId' when 'RequestId'
response[name] = @value response[name] = value
end end
end end

View file

@ -14,13 +14,13 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'AttributeNameCount', 'AttributeNamesSizeBytes', 'AttributeValueCount', 'AttributeValuesSizeBytes', 'ItemCount', 'ItemNamesSizeBytes' when 'AttributeNameCount', 'AttributeNamesSizeBytes', 'AttributeValueCount', 'AttributeValuesSizeBytes', 'ItemCount', 'ItemNamesSizeBytes'
response[name] = @value.to_i response[name] = value.to_i
when 'BoxUsage' when 'BoxUsage'
response[name] = @value.to_f response[name] = value.to_f
when 'RequestId' when 'RequestId'
response[name] = @value response[name] = value
when 'Timestamp' when 'Timestamp'
response[name] = Time.at(@value.to_i) response[name] = Time.at(value.to_i)
end end
end end

View file

@ -17,14 +17,14 @@ module Fog
when 'Attribute' when 'Attribute'
@attribute = nil @attribute = nil
when 'BoxUsage' when 'BoxUsage'
response[name] = @value.to_f response[name] = value.to_f
when 'Name' when 'Name'
@attribute = @value @attribute = value
response['Attributes'][@attribute] ||= [] response['Attributes'][@attribute] ||= []
when 'RequestId' when 'RequestId'
response[name] = @value response[name] = value
when 'Value' when 'Value'
response['Attributes'][@attribute] << sdb_decode(@value) response['Attributes'][@attribute] << sdb_decode(value)
end end
end end

View file

@ -14,11 +14,11 @@ module Fog
def end_element(name) def end_element(name)
case(name) case(name)
when 'BoxUsage' when 'BoxUsage'
response[name] = @value.to_f response[name] = value.to_f
when 'DomainName' when 'DomainName'
response['Domains'] << @value response['Domains'] << value
when 'NextToken', 'RequestId' when 'NextToken', 'RequestId'
response[name] = @value response[name] = value
end end
end end

View file

@ -15,21 +15,21 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'BoxUsage' when 'BoxUsage'
response[name] = @value.to_f response[name] = value.to_f
when 'Item' when 'Item'
@item_name = @attribute_name = nil @item_name = @attribute_name = nil
when 'Name' when 'Name'
if @item_name.nil? if @item_name.nil?
@item_name = @value @item_name = value
response['Items'][@item_name] = {} response['Items'][@item_name] = {}
else else
@attribute_name = @value @attribute_name = value
response['Items'][@item_name][@attribute_name] ||= [] response['Items'][@item_name][@attribute_name] ||= []
end end
when 'NextToken', 'RequestId' when 'NextToken', 'RequestId'
response[name] = @value response[name] = value
when 'Value' when 'Value'
response['Items'][@item_name][@attribute_name] << sdb_decode(@value) response['Items'][@item_name][@attribute_name] << sdb_decode(value)
end end
end end

View file

@ -21,31 +21,31 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'AwsAccountNumber' when 'AwsAccountNumber'
@response['DistributionConfig']['TrustedSigners'] << @value @response['DistributionConfig']['TrustedSigners'] << value
when 'Bucket', 'Prefix' when 'Bucket', 'Prefix'
@response['DistributionConfig']['Logging'][name] = @value @response['DistributionConfig']['Logging'][name] = value
when 'CNAME' when 'CNAME'
@response['DistributionConfig']['CNAME'] << @value @response['DistributionConfig']['CNAME'] << value
when 'DNSName', 'OriginAccessIdentity', 'OriginProtocolPolicy' when 'DNSName', 'OriginAccessIdentity', 'OriginProtocolPolicy'
@response['DistributionConfig'][@origin][name] = @value @response['DistributionConfig'][@origin][name] = value
when 'DomainName', 'Id', 'Status' when 'DomainName', 'Id', 'Status'
@response[name] = @value @response[name] = value
when 'CallerReference', 'Comment', 'DefaultRootObject', 'Origin', 'OriginAccessIdentity' when 'CallerReference', 'Comment', 'DefaultRootObject', 'Origin', 'OriginAccessIdentity'
@response['DistributionConfig'][name] = @value @response['DistributionConfig'][name] = value
when 'Enabled' when 'Enabled'
if @value == 'true' if value == 'true'
@response['DistributionConfig'][name] = true @response['DistributionConfig'][name] = true
else else
@response['DistributionConfig'][name] = false @response['DistributionConfig'][name] = false
end end
when 'HTTPPort', 'HTTPSPort' when 'HTTPPort', 'HTTPSPort'
@response['DistributionConfig'][@origin][name] = @value.to_i @response['DistributionConfig'][@origin][name] = value.to_i
when 'InProgressInvalidationBatches' when 'InProgressInvalidationBatches'
@response[name] = @value.to_i @response[name] = value.to_i
when 'LastModifiedTime' when 'LastModifiedTime'
@response[name] = Time.parse(@value) @response[name] = Time.parse(value)
when 'Protocol' when 'Protocol'
@response['DistributionConfig']['RequireProtocols'] = @value @response['DistributionConfig']['RequireProtocols'] = value
when 'Self' when 'Self'
@response['DistributionConfig']['TrustedSigners'] << 'Self' @response['DistributionConfig']['TrustedSigners'] << 'Self'
end end

View file

@ -25,31 +25,31 @@ module Fog
@response['DistributionSummary'] << @distribution_summary @response['DistributionSummary'] << @distribution_summary
@distribution_summary = { 'CNAME' => [], 'TrustedSigners' => [] } @distribution_summary = { 'CNAME' => [], 'TrustedSigners' => [] }
when 'Comment', 'DomainName', 'Id', 'Origin', 'Status' when 'Comment', 'DomainName', 'Id', 'Origin', 'Status'
@distribution_summary[name] = @value @distribution_summary[name] = value
when 'CNAME' when 'CNAME'
@distribution_summary[name] << @value @distribution_summary[name] << value
when 'DNSName', 'OriginAccessIdentity', 'OriginProtocolPolicy' when 'DNSName', 'OriginAccessIdentity', 'OriginProtocolPolicy'
@distribution_summary[@origin][name] = @value @distribution_summary[@origin][name] = value
when 'Enabled' when 'Enabled'
if @value == 'true' if value == 'true'
@distribution_summary[name] = true @distribution_summary[name] = true
else else
@distribution_summary[name] = false @distribution_summary[name] = false
end end
when 'HTTPPort', 'HTTPSPort' when 'HTTPPort', 'HTTPSPort'
@distribution_summary[@origin][name] = @value.to_i @distribution_summary[@origin][name] = value.to_i
when 'LastModifiedTime' when 'LastModifiedTime'
@distribution_summary[name] = Time.parse(@value) @distribution_summary[name] = Time.parse(value)
when 'IsTruncated' when 'IsTruncated'
if @value == 'true' if value == 'true'
@response[name] = true @response[name] = true
else else
@response[name] = false @response[name] = false
end end
when 'Marker', 'NextMarker' when 'Marker', 'NextMarker'
@response[name] = @value @response[name] = value
when 'MaxItems' when 'MaxItems'
@response[name] = @value.to_i @response[name] = value.to_i
end end
end end

View file

@ -12,11 +12,11 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'CallerReference' when 'CallerReference'
@response['InvalidationBatch'][name] = @value @response['InvalidationBatch'][name] = value
when 'CreateTime', 'Id', 'Status' when 'CreateTime', 'Id', 'Status'
@response[name] = @value @response[name] = value
when 'Path' when 'Path'
@response['InvalidationBatch'][name] << @value @response['InvalidationBatch'][name] << value
end end
end end

View file

@ -8,7 +8,7 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'publicIp', 'requestId' when 'publicIp', 'requestId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -8,9 +8,9 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'attachTime' when 'attachTime'
@response[name] = Time.parse(@value) @response[name] = Time.parse(value)
when 'device', 'instanceId', 'requestId', 'status', 'volumeId' when 'device', 'instanceId', 'requestId', 'status', 'volumeId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -8,9 +8,9 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'requestId' when 'requestId'
@response[name] = @value @response[name] = value
when 'return' when 'return'
if @value == 'true' if value == 'true'
@response[name] = true @response[name] = true
else else
@response[name] = false @response[name] = false

View file

@ -8,7 +8,7 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'instanceId', 'requestId', 'name', 'description', 'noReboot', 'imageId' when 'instanceId', 'requestId', 'name', 'description', 'noReboot', 'imageId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -8,7 +8,7 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'keyFingerprint', 'keyMaterial', 'keyName', 'requestId' when 'keyFingerprint', 'keyMaterial', 'keyName', 'requestId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -8,13 +8,13 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'description', 'ownerId', 'progress', 'snapshotId', 'status', 'volumeId' when 'description', 'ownerId', 'progress', 'snapshotId', 'status', 'volumeId'
@response[name] = @value @response[name] = value
when 'requestId' when 'requestId'
@response[name] = @value @response[name] = value
when 'startTime' when 'startTime'
@response[name] = Time.parse(@value) @response[name] = Time.parse(value)
when 'volumeSize' when 'volumeSize'
@response[name] = @value.to_i @response[name] = value.to_i
end end
end end

View file

@ -8,11 +8,11 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'availabilityZone', 'requestId', 'snapshotId', 'status', 'volumeId' when 'availabilityZone', 'requestId', 'snapshotId', 'status', 'volumeId'
@response[name] = @value @response[name] = value
when 'createTime' when 'createTime'
@response[name] = Time.parse(@value) @response[name] = Time.parse(value)
when 'size' when 'size'
@response[name] = @value.to_i @response[name] = value.to_i
end end
end end

View file

@ -8,7 +8,7 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'return', 'requestId', 'imageId' when 'return', 'requestId', 'imageId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -13,12 +13,12 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'instanceId', 'publicIp' when 'instanceId', 'publicIp'
@address[name] = @value @address[name] = value
when 'item' when 'item'
@response['addressesSet'] << @address @response['addressesSet'] << @address
@address = {} @address = {}
when 'requestId' when 'requestId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -16,11 +16,11 @@ module Fog
@response['availabilityZoneInfo'] << @availability_zone @response['availabilityZoneInfo'] << @availability_zone
@availability_zone = { 'messageSet' => [] } @availability_zone = { 'messageSet' => [] }
when 'message' when 'message'
@availability_zone['messageSet'] << @value @availability_zone['messageSet'] << value
when 'regionName', 'zoneName', 'zoneState' when 'regionName', 'zoneName', 'zoneState'
@availability_zone[name] = @value @availability_zone[name] = value
when 'requestId' when 'requestId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -29,7 +29,7 @@ module Fog
@image['tagSet'][@tag['key']] = @tag['value'] @image['tagSet'][@tag['key']] = @tag['value']
@tag = {} @tag = {}
when 'key', 'value' when 'key', 'value'
@tag[name] = @value @tag[name] = value
when 'tagSet' when 'tagSet'
@in_tag_set = false @in_tag_set = false
end end
@ -38,9 +38,9 @@ module Fog
when 'blockDeviceMapping' when 'blockDeviceMapping'
@in_block_device_mapping = false @in_block_device_mapping = false
when 'deviceName', 'virtualName', 'snapshotId', 'deleteOnTermination' when 'deviceName', 'virtualName', 'snapshotId', 'deleteOnTermination'
@block_device_mapping[name] = @value @block_device_mapping[name] = value
when 'volumeSize' when 'volumeSize'
@block_device_mapping[name] = @value.to_i @block_device_mapping[name] = value.to_i
when 'item' when 'item'
@image['blockDeviceMapping'] << @block_device_mapping @image['blockDeviceMapping'] << @block_device_mapping
@block_device_mapping = {} @block_device_mapping = {}
@ -48,9 +48,9 @@ module Fog
else else
case name case name
when 'architecture', 'description', 'imageId', 'imageLocation', 'imageOwnerId', 'imageState', 'imageType', 'kernelId', 'name', 'platform', 'ramdiskId', 'rootDeviceType','rootDeviceName','virtualizationType' when 'architecture', 'description', 'imageId', 'imageLocation', 'imageOwnerId', 'imageState', 'imageType', 'kernelId', 'name', 'platform', 'ramdiskId', 'rootDeviceType','rootDeviceName','virtualizationType'
@image[name] = @value @image[name] = value
when 'isPublic' when 'isPublic'
if @value == 'true' if value == 'true'
@image[name] = true @image[name] = true
else else
@image[name] = false @image[name] = false
@ -59,9 +59,9 @@ module Fog
@response['imagesSet'] << @image @response['imagesSet'] << @image
@image = { 'blockDeviceMapping' => [], 'productCodes' => [], 'tagSet' => {} } @image = { 'blockDeviceMapping' => [], 'productCodes' => [], 'tagSet' => {} }
when 'productCode' when 'productCode'
@image['productCodes'] << @value @image['productCodes'] << value
when 'requestId' when 'requestId'
@response[name] = @value @response[name] = value
end end
end end
end end

View file

@ -34,34 +34,34 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'amiLaunchIndex' when 'amiLaunchIndex'
@instance[name] = @value.to_i @instance[name] = value.to_i
when 'availabilityZone' when 'availabilityZone'
@instance['placement'][name] = @value @instance['placement'][name] = value
when 'architecture', 'clientToken', 'dnsName', 'imageId', when 'architecture', 'clientToken', 'dnsName', 'imageId',
'instanceId', 'instanceType', 'ipAddress', 'kernelId', 'instanceId', 'instanceType', 'ipAddress', 'kernelId',
'keyName', 'privateDnsName', 'privateIpAddress', 'ramdiskId', 'keyName', 'privateDnsName', 'privateIpAddress', 'ramdiskId',
'reason', 'rootDeviceType' 'reason', 'rootDeviceType'
@instance[name] = @value @instance[name] = value
when 'attachTime' when 'attachTime'
@block_device_mapping[name] = Time.parse(@value) @block_device_mapping[name] = Time.parse(value)
when 'blockDeviceMapping' when 'blockDeviceMapping'
@in_block_device_mapping = false @in_block_device_mapping = false
when 'code' when 'code'
if @in_instance_state if @in_instance_state
@instance['instanceState'][name] = @value.to_i @instance['instanceState'][name] = value.to_i
elsif @in_state_reason elsif @in_state_reason
@instance['stateReason'][name] = @value.to_i @instance['stateReason'][name] = value.to_i
end end
when 'deleteOnTermination' when 'deleteOnTermination'
if @value == 'true' if value == 'true'
@block_device_mapping[name] = true @block_device_mapping[name] = true
else else
@block_device_mapping[name] = false @block_device_mapping[name] = false
end end
when 'deviceName', 'status', 'volumeId' when 'deviceName', 'status', 'volumeId'
@block_device_mapping[name] = @value @block_device_mapping[name] = value
when 'groupId' when 'groupId'
@reservation['groupSet'] << @value @reservation['groupSet'] << value
when 'groupSet', 'productCodes' when 'groupSet', 'productCodes'
@in_subset = false @in_subset = false
when 'instancesSet' when 'instancesSet'
@ -83,23 +83,23 @@ module Fog
@reservation = { 'groupSet' => [], 'instancesSet' => [] } @reservation = { 'groupSet' => [], 'instancesSet' => [] }
end end
when 'key', 'value' when 'key', 'value'
@tag[name] = @value @tag[name] = value
when 'launchTime' when 'launchTime'
@instance[name] = Time.parse(@value) @instance[name] = Time.parse(value)
when 'name' when 'name'
if @in_instance_state if @in_instance_state
@instance['instanceState'][name] = @value @instance['instanceState'][name] = value
elsif @in_state_reason elsif @in_state_reason
@instance['stateReason'][name] = @value @instance['stateReason'][name] = value
end end
when 'ownerId', 'reservationId' when 'ownerId', 'reservationId'
@reservation[name] = @value @reservation[name] = value
when 'requestId' when 'requestId'
@response[name] = @value @response[name] = value
when 'productCode' when 'productCode'
@instance['productCodes'] << @value @instance['productCodes'] << value
when 'state' when 'state'
if @value == 'true' if value == 'true'
@instance['monitoring'][name] = true @instance['monitoring'][name] = true
else else
@instance['monitoring'][name] = false @instance['monitoring'][name] = false

View file

@ -16,9 +16,9 @@ module Fog
@response['keySet'] << @key @response['keySet'] << @key
@key = {} @key = {}
when 'keyFingerprint', 'keyName' when 'keyFingerprint', 'keyName'
@key[name] = @value @key[name] = value
when 'requestId' when 'requestId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -16,9 +16,9 @@ module Fog
@response['regionInfo'] << @region @response['regionInfo'] << @region
@region = {} @region = {}
when 'regionEndpoint', 'regionName' when 'regionEndpoint', 'regionName'
@region[name] = @value @region[name] = value
when 'requestId' when 'requestId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -13,18 +13,18 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'availabilityZone', 'instanceType', 'productDescription', 'reservedInstancesId', 'state' when 'availabilityZone', 'instanceType', 'productDescription', 'reservedInstancesId', 'state'
@reserved_instance[name] = @value @reserved_instance[name] = value
when 'duration', 'instanceCount' when 'duration', 'instanceCount'
@reserved_instance[name] = @value.to_i @reserved_instance[name] = value.to_i
when 'fixedPrice', 'usagePrice' when 'fixedPrice', 'usagePrice'
@reserved_instance[name] = @value.to_f @reserved_instance[name] = value.to_f
when 'item' when 'item'
@response['reservedInstancesSet'] << @reserved_instance @response['reservedInstancesSet'] << @reserved_instance
@reserved_instance = {} @reserved_instance = {}
when 'requestId' when 'requestId'
@response[name] = @value @response[name] = value
when 'start' when 'start'
@response[name] = Time.parse(@value) @response[name] = Time.parse(value)
end end
end end

View file

@ -13,16 +13,16 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'availabilityZone', 'instanceType', 'productDescription', 'reservedInstancesOfferingId' when 'availabilityZone', 'instanceType', 'productDescription', 'reservedInstancesOfferingId'
@reserved_instances_offering[name] = @value @reserved_instances_offering[name] = value
when 'duration' when 'duration'
@reserved_instances_offering[name] = @value.to_i @reserved_instances_offering[name] = value.to_i
when 'fixedPrice', 'usagePrice' when 'fixedPrice', 'usagePrice'
@reserved_instances_offering[name] = @value.to_f @reserved_instances_offering[name] = value.to_f
when 'item' when 'item'
@response['reservedInstancesOfferingsSet'] << @reserved_instances_offering @response['reservedInstancesOfferingsSet'] << @reserved_instances_offering
@reserved_instances_offering = {} @reserved_instances_offering = {}
when 'requestId' when 'requestId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -28,23 +28,23 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'cidrIp' when 'cidrIp'
@ip_range[name] = @value @ip_range[name] = value
when 'fromPort', 'toPort' when 'fromPort', 'toPort'
@ip_permission[name] = @value.to_i @ip_permission[name] = value.to_i
when 'groups' when 'groups'
@in_groups = false @in_groups = false
when 'groupDescription', 'ownerId' when 'groupDescription', 'ownerId'
@security_group[name] = @value @security_group[name] = value
when 'groupName' when 'groupName'
if @in_groups if @in_groups
@group[name] = @value @group[name] = value
else else
@security_group[name] = @value @security_group[name] = value
end end
when 'ipPermissions' when 'ipPermissions'
@in_ip_permissions = false @in_ip_permissions = false
when 'ipProtocol' when 'ipProtocol'
@ip_permission[name] = @value @ip_permission[name] = value
when 'ipRanges' when 'ipRanges'
@in_ip_ranges = false @in_ip_ranges = false
when 'item' when 'item'
@ -62,9 +62,9 @@ module Fog
@security_group = { 'ipPermissions' => [] } @security_group = { 'ipPermissions' => [] }
end end
when 'requestId' when 'requestId'
@response[name] = @value @response[name] = value
when 'userId' when 'userId'
@group[name] = @value @group[name] = value
end end
end end

View file

@ -25,7 +25,7 @@ module Fog
@snapshot['tagSet'][@tag['key']] = @tag['value'] @snapshot['tagSet'][@tag['key']] = @tag['value']
@tag = {} @tag = {}
when 'key', 'value' when 'key', 'value'
@tag[name] = @value @tag[name] = value
when 'tagSet' when 'tagSet'
@in_tag_set = false @in_tag_set = false
end end
@ -35,13 +35,13 @@ module Fog
@response['snapshotSet'] << @snapshot @response['snapshotSet'] << @snapshot
@snapshot = { 'tagSet' => {} } @snapshot = { 'tagSet' => {} }
when 'description', 'ownerId', 'progress', 'snapshotId', 'status', 'volumeId' when 'description', 'ownerId', 'progress', 'snapshotId', 'status', 'volumeId'
@snapshot[name] ||= @value @snapshot[name] ||= value
when 'requestId' when 'requestId'
@response[name] = @value @response[name] = value
when 'startTime' when 'startTime'
@snapshot[name] = Time.parse(@value) @snapshot[name] = Time.parse(value)
when 'volumeSize' when 'volumeSize'
@snapshot[name] = @value.to_i @snapshot[name] = value.to_i
end end
end end
end end

View file

@ -13,12 +13,12 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'resourceId', 'resourceType', 'key', 'value' when 'resourceId', 'resourceType', 'key', 'value'
@tag[name] = @value @tag[name] = value
when 'item' when 'item'
@response['tagSet'] << @tag @response['tagSet'] << @tag
@tag = {} @tag = {}
when 'requestId' when 'requestId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -29,11 +29,11 @@ module Fog
when 'attachmentSet' when 'attachmentSet'
@in_attachment_set = false @in_attachment_set = false
when 'attachTime' when 'attachTime'
@attachment[name] = Time.parse(@value) @attachment[name] = Time.parse(value)
when 'deleteOnTermination' when 'deleteOnTermination'
@attachment[name] = @value == 'true' @attachment[name] = value == 'true'
when 'device', 'instanceId', 'status', 'volumeId' when 'device', 'instanceId', 'status', 'volumeId'
@attachment[name] = @value @attachment[name] = value
when 'item' when 'item'
@volume['attachmentSet'] << @attachment @volume['attachmentSet'] << @attachment
@attachment = {} @attachment = {}
@ -41,7 +41,7 @@ module Fog
elsif @in_tag_set elsif @in_tag_set
case name case name
when 'key', 'value' when 'key', 'value'
@tag[name] = @value @tag[name] = value
when 'item' when 'item'
@volume['tagSet'][@tag['key']] = @tag['value'] @volume['tagSet'][@tag['key']] = @tag['value']
@tag = {} @tag = {}
@ -51,16 +51,16 @@ module Fog
else else
case name case name
when 'availabilityZone', 'snapshotId', 'status', 'volumeId' when 'availabilityZone', 'snapshotId', 'status', 'volumeId'
@volume[name] = @value @volume[name] = value
when 'createTime' when 'createTime'
@volume[name] = Time.parse(@value) @volume[name] = Time.parse(value)
when 'item' when 'item'
@response['volumeSet'] << @volume @response['volumeSet'] << @volume
@volume = { 'attachmentSet' => [], 'tagSet' => {} } @volume = { 'attachmentSet' => [], 'tagSet' => {} }
when 'requestId' when 'requestId'
@response[name] = @value @response[name] = value
when 'size' when 'size'
@volume[name] = @value.to_i @volume[name] = value.to_i
end end
end end
end end

View file

@ -8,9 +8,9 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'attachTime' when 'attachTime'
@response[name] = Time.parse(@value) @response[name] = Time.parse(value)
when 'device', 'instanceId', 'requestId', 'status', 'volumeId' when 'device', 'instanceId', 'requestId', 'status', 'volumeId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -12,15 +12,11 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'instanceId', 'requestId' when 'instanceId', 'requestId'
@response[name] = @value @response[name] = value
when 'output' when 'output'
@response[name] = if @value @response[name] = value && Base64.decode64(value)
Base64.decode64(@value)
else
nil
end
when 'timestamp' when 'timestamp'
@response[name] = Time.parse(@value) @response[name] = Time.parse(value)
end end
end end

View file

@ -8,7 +8,7 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'keyFingerprint', 'keyName', 'requestId' when 'keyFingerprint', 'keyName', 'requestId'
@response[name] = @value @response[name] = value
end end
end end

View file

@ -14,14 +14,14 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'requestId' when 'requestId'
@response['requestId'] = @value @response['requestId'] = value
when 'instanceId' when 'instanceId'
@current_instance_set['instanceId'] = @value @current_instance_set['instanceId'] = value
when 'item' when 'item'
@instance_set << @current_instance_set @instance_set << @current_instance_set
@current_instance_set = {} @current_instance_set = {}
when 'state' when 'state'
@current_instance_set['monitoring'] = @value @current_instance_set['monitoring'] = value
when 'instancesSet' when 'instancesSet'
@response['instancesSet'] = @instance_set @response['instancesSet'] = @instance_set
end end

View file

@ -8,7 +8,7 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'requestId', 'imageId' when 'requestId', 'imageId'
@response[name] = @value @response[name] = value
end end
end end

Some files were not shown because too many files have changed in this diff Show more