@@ -48,9 +48,7 @@ def initialize(options)
4848 @operation_inputs = operation_inputs . map do |operation_inputs_test |
4949 OperationInputsTest . new (
5050 service : @service ,
51- operation_name : Underscore . underscore (
52- operation_inputs_test [ 'operationName' ]
53- ) ,
51+ operation_name : operation_inputs_test [ 'operationName' ] ,
5452 operation_params : operation_inputs_test [ 'operationParams' ] || { } ,
5553 built_in_params : operation_inputs_test [ 'builtInParams' ] || { } ,
5654 client_params : operation_inputs_test [ 'clientParams' ] || { }
@@ -110,9 +108,13 @@ class OperationInputsTest
110108
111109 def initialize ( options )
112110 @service = options [ :service ]
113- @operation_name = options [ :operation_name ]
111+ @api = @service . api
112+ @operation_name = Underscore . underscore ( options [ :operation_name ] )
113+ input_shape_name = @api [ 'operations' ] [ options [ :operation_name ] ] [ 'input' ] [ 'shape' ]
114+ input = @api [ 'shapes' ] [ input_shape_name ]
114115 @operation_params = options [ :operation_params ] . map do |k , v |
115- Param . new ( Underscore . underscore ( k ) , transform_operation_values ( v ) )
116+ member_shape = @api [ 'shapes' ] [ input [ 'members' ] [ k ] [ 'shape' ] ]
117+ Param . new ( Underscore . underscore ( k ) , transform_operation_values ( v , member_shape ) )
116118 end
117119 @client_params = options [ :client_params ] . map do |k , v |
118120 Param . new ( Underscore . underscore ( k ) , v )
@@ -126,6 +128,10 @@ def initialize(options)
126128 !options [ :built_in_params ] . include? ( 'AWS::S3::UseGlobalEndpoint' )
127129 @client_params << built_in_to_param ( 'AWS::S3::UseGlobalEndpoint' , false )
128130 end
131+
132+ if @service . identifier == 'dynamodb'
133+ @client_params << Param . new ( :simple_attributes , false , true )
134+ end
129135 end
130136
131137 # @return String
@@ -138,14 +144,21 @@ def initialize(options)
138144 attr_reader :client_params
139145
140146 private
141- def transform_operation_values ( value )
142- case value
143- when Hash
147+ def transform_operation_values ( value , ref )
148+ case ref [ 'type' ]
149+ when 'structure' , 'union'
150+ value . each_with_object ( { } ) do |( k , v ) , o |
151+ member_shape = @api [ 'shapes' ] [ ref [ 'members' ] [ k ] [ 'shape' ] ]
152+ o [ Underscore . underscore ( k ) . to_sym ] = transform_operation_values ( v , member_shape )
153+ end
154+ when 'list'
155+ member_shape = @api [ 'shapes' ] [ ref [ 'member' ] [ 'shape' ] ]
156+ value . map { |v | transform_operation_values ( v , member_shape ) }
157+ when 'map'
158+ member_shape = @api [ 'shapes' ] [ ref [ 'value' ] [ 'shape' ] ]
144159 value . each_with_object ( { } ) do |( k , v ) , o |
145- o [ Underscore . underscore ( k ) . to_sym ] = transform_operation_values ( v )
160+ o [ k ] = transform_operation_values ( v , member_shape )
146161 end
147- when Array
148- value . map { |v | transform_operation_values ( v ) }
149162 else
150163 value
151164 end
0 commit comments