diff --git a/codegen/projections/rails_json/lib/rails_json/types.rb b/codegen/projections/rails_json/lib/rails_json/types.rb index ec7e25737..a6d8736ce 100644 --- a/codegen/projections/rails_json/lib/rails_json/types.rb +++ b/codegen/projections/rails_json/lib/rails_json/types.rb @@ -1984,7 +1984,7 @@ def to_h class Unknown < MyUnion def initialize(name:, value:) - super({name: name, value: value}) + super({name: name || 'Unknown', value: value}) end def to_h @@ -2479,7 +2479,7 @@ def to_h class Unknown < PlayerAction def initialize(name:, value:) - super({name: name, value: value}) + super({name: name || 'Unknown', value: value}) end def to_h @@ -3376,7 +3376,7 @@ def to_h class Unknown < UnionPayload def initialize(name:, value:) - super({name: name, value: value}) + super({name: name || 'Unknown', value: value}) end def to_h @@ -3406,7 +3406,7 @@ def to_h class Unknown < UnionWithJsonName def initialize(name:, value:) - super({name: name, value: value}) + super({name: name || 'Unknown', value: value}) end def to_h diff --git a/codegen/projections/white_label/lib/white_label/event_stream.rb b/codegen/projections/white_label/lib/white_label/event_stream.rb index 9413d990b..6f58e12eb 100644 --- a/codegen/projections/white_label/lib/white_label/event_stream.rb +++ b/codegen/projections/white_label/lib/white_label/event_stream.rb @@ -93,7 +93,7 @@ def parse_event(type, message) when 'ServerErrorEvent' Types::Events::ServerErrorEvent.new(Parsers::EventStream::ServerErrorEvent.parse(message)) else - Types::Events::Unknown.new(name: type || 'unknown', value: message) + Types::Events::Unknown.new(name: type, value: message) end end @@ -103,8 +103,8 @@ def parse_exception_event(type, message) data = Parsers::EventStream::ServerErrorEvent.parse(message) Errors::ServerErrorEvent.new(data: data, error_code: 'WhiteLabel::Types::Events::ServerErrorEvent') else - data = Types::Events::Unknown.new(name: type || 'unknown', value: message) - Errors::ApiError.new(error_code: type || 'unknown', metadata: {data: data}) + data = Types::Events::Unknown.new(name: type, value: message) + Errors::ApiError.new(error_code: type, metadata: {data: data}) end end diff --git a/codegen/projections/white_label/lib/white_label/types.rb b/codegen/projections/white_label/lib/white_label/types.rb index 4f80dee5f..470680a87 100644 --- a/codegen/projections/white_label/lib/white_label/types.rb +++ b/codegen/projections/white_label/lib/white_label/types.rb @@ -468,7 +468,7 @@ def to_h class Unknown < Events def initialize(name:, value:) - super({name: name, value: value}) + super({name: name || 'Unknown', value: value}) end def to_h @@ -1414,7 +1414,7 @@ def to_s class Unknown < Union def initialize(name:, value:) - super({name: name, value: value}) + super({name: name || 'Unknown', value: value}) end def to_h diff --git a/codegen/smithy-ruby-codegen/src/main/java/software/amazon/smithy/ruby/codegen/generators/EventStreamGenerator.java b/codegen/smithy-ruby-codegen/src/main/java/software/amazon/smithy/ruby/codegen/generators/EventStreamGenerator.java index 3ff48fbba..5f4b23a59 100644 --- a/codegen/smithy-ruby-codegen/src/main/java/software/amazon/smithy/ruby/codegen/generators/EventStreamGenerator.java +++ b/codegen/smithy-ruby-codegen/src/main/java/software/amazon/smithy/ruby/codegen/generators/EventStreamGenerator.java @@ -238,7 +238,7 @@ private void renderParseEventMethod( } }) .openBlock("else") - .write("$T::Unknown.new(name: type || 'unknown', value: message)", + .write("$T::Unknown.new(name: type, value: message)", symbolProvider.toSymbol(eventStreamUnion)) .closeBlock("end") .closeBlock("end"); @@ -267,9 +267,9 @@ private void renderParseExceptionMethod( } }) .openBlock("else") - .write("data = $T::Unknown.new(name: type || 'unknown', value: message)", + .write("data = $T::Unknown.new(name: type, value: message)", symbolProvider.toSymbol(eventStreamUnion)) - .write("Errors::ApiError.new(error_code: type || 'unknown', " + .write("Errors::ApiError.new(error_code: type, " + "metadata: {data: data})") .closeBlock("end") .closeBlock("end"); diff --git a/codegen/smithy-ruby-codegen/src/main/java/software/amazon/smithy/ruby/codegen/generators/types/UnionGenerator.java b/codegen/smithy-ruby-codegen/src/main/java/software/amazon/smithy/ruby/codegen/generators/types/UnionGenerator.java index 1f0c054d7..064ca6763 100644 --- a/codegen/smithy-ruby-codegen/src/main/java/software/amazon/smithy/ruby/codegen/generators/types/UnionGenerator.java +++ b/codegen/smithy-ruby-codegen/src/main/java/software/amazon/smithy/ruby/codegen/generators/types/UnionGenerator.java @@ -72,7 +72,7 @@ public void render() { writer .openBlock("class Unknown < $T", symbolProvider.toSymbol(shape)) .openBlock("def initialize(name:, value:)") - .write("super({name: name, value: value})") + .write("super({name: name || 'Unknown', value: value})") .closeBlock("end") .write("") .openBlock("def to_h") diff --git a/hearth/sig/lib/hearth/http/api_error.rbs b/hearth/sig/lib/hearth/http/api_error.rbs deleted file mode 100644 index 895ea2556..000000000 --- a/hearth/sig/lib/hearth/http/api_error.rbs +++ /dev/null @@ -1,13 +0,0 @@ -module Hearth - module HTTP - class ApiError < Hearth::ApiError - def initialize: (http_resp: Response, error_code: String, ?metadata: Hash[Symbol, untyped], ?message: String?) -> void - - attr_reader http_status: Integer - - attr_reader http_fields: Fields - - attr_reader http_body: IO - end - end -end