@@ -19,7 +19,7 @@ def types
1919 Model ::ServiceIndex
2020 . new ( @model )
2121 . shapes_for ( @plan . service )
22- . select { |_key , shape | %w[ enum intEnum structure union ] . include? ( shape [ 'type' ] ) }
22+ . select { |_key , shape | %w[ structure union ] . include? ( shape [ 'type' ] ) }
2323 . map { |id , shape | build_type ( id , shape ) }
2424 end
2525
@@ -28,7 +28,6 @@ def types
2828 def build_type ( id , shape )
2929 args = [ @plan . service , @model , id , shape ]
3030 case shape [ 'type' ]
31- when 'enum' , 'intEnum' then EnumType . new ( *args )
3231 when 'structure' then StructureType . new ( *args )
3332 when 'union' then UnionType . new ( *args )
3433 end
@@ -99,15 +98,6 @@ def unstable_docstrings
9998 end
10099 end
101100
102- # @api private
103- class EnumType < Type
104- private
105-
106- def build_members ( members )
107- members . map { |name , member | EnumMember . new ( @service , @model , name , member ) }
108- end
109- end
110-
111101 # @api private
112102 class StructureType < Type
113103 def input?
@@ -208,21 +198,6 @@ def unstable_docstrings
208198 end
209199 end
210200
211- # @api private
212- class EnumMember < Member
213- def value
214- value = @traits [ 'smithy.api#enumValue' ]
215- case value
216- when String then "'#{ value } '"
217- else value
218- end
219- end
220-
221- def documentation_docstrings
222- @member . fetch ( 'traits' , { } ) . fetch ( 'smithy.api#documentation' , '' ) . split ( "\n " )
223- end
224- end
225-
226201 # @api private
227202 class StructMember < Member
228203 def docstrings # rubocop:disable Metrics/AbcSize
@@ -244,9 +219,10 @@ def default?
244219
245220 def default
246221 default = @member . dig ( 'traits' , 'smithy.api#default' )
222+ return 'nil' if default . nil?
223+
247224 case @target [ 'type' ]
248225 when 'blob' then "Base64.strict_decode64('#{ default } ')"
249- when 'bigDecimal' then "BigDecimal('#{ default } ')"
250226 when 'document' then document_default ( default )
251227 when 'enum' , 'string' then "'#{ default } '"
252228 when 'timestamp' then timestamp_default ( default )
@@ -273,7 +249,6 @@ def return_docstrings
273249
274250 def document_default ( default )
275251 case default
276- when nil then 'nil'
277252 when String then "'#{ default } '"
278253 else default
279254 end
0 commit comments