Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/aws_codegen/types.ex
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ defmodule AWS.CodeGen.Types do
type =
"#{AWS.CodeGen.Name.to_snake_case(String.replace(shape_name, ~r/com\.amazonaws\.[^#]+#/, ""))}"
|> AWS.CodeGen.Util.maybe_add_parens()

if reserved_type(type) do
"#{String.downcase(String.replace(context.module_name, ["aws_", "AWS."], ""))}_#{type}"
else
Expand Down Expand Up @@ -158,6 +157,7 @@ defmodule AWS.CodeGen.Types do
defp shape_to_type(_, %Shape{type: "integer"}, _module_name), do: "integer()"
defp shape_to_type(_, %Shape{type: "boolean"}, _module_name), do: "boolean()"
defp shape_to_type(_, %Shape{type: "enum"}, _module_name), do: "list(any())"
defp shape_to_type(_, %Shape{type: "intEnum"}, _module_name), do: "list(integer())"
defp shape_to_type(_, %Shape{type: "union"}, _module_name), do: "list()"
defp shape_to_type(_, %Shape{type: "document"}, _module_name), do: "any()"

Expand Down Expand Up @@ -198,7 +198,7 @@ defmodule AWS.CodeGen.Types do
end

defp reserved_type(type) do
type == "node" || type == "term" || type == "function" || type == "reference" || type == "identifier"
type == "node" || type == "term" || type == "function" || type == "reference" || type == "identifier" || type == "none" || type == "none()"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a little bit funky to support none and none() here but it's a bit finicky to get these types to work properly and this at least covers the None type that AWS introduced recently so I'll let it be for the time being.

end

def function_argument_type(:elixir, action) do
Expand Down
1 change: 1 addition & 0 deletions lib/aws_codegen/util.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ defmodule AWS.CodeGen.Util do

case signature do
["aws.auth#sig" <> version] -> version
["aws.auth#sigv4", "aws.auth#sigv4a"] -> "aws.auth#sigv4"
[] -> nil
end
end
Expand Down
Loading