-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
code generation wrappers refactoring and protocol test clients genera…
…tion
- Loading branch information
1 parent
fd99d0c
commit 5ea3ad1
Showing
10 changed files
with
815 additions
and
532 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...a/com/amazonaws/util/awsclientgenerator/domainmodels/c2j/C2jXmlNamespaceDeserializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.amazonaws.util.awsclientgenerator.domainmodels.c2j; | ||
|
||
import com.google.gson.*; | ||
|
||
import java.lang.reflect.Type; | ||
import java.util.Map; | ||
import java.util.stream.Collectors; | ||
import java.util.stream.StreamSupport; | ||
import java.util.List; | ||
|
||
public class C2jXmlNamespaceDeserializer implements JsonDeserializer<C2jXmlNamespace> { | ||
|
||
@Override | ||
public C2jXmlNamespace deserialize(JsonElement jsonElement, Type type, | ||
JsonDeserializationContext context) throws JsonParseException { | ||
C2jXmlNamespace retValue = new C2jXmlNamespace(); | ||
|
||
if (jsonElement.isJsonObject()) { | ||
JsonObject jsonObject = jsonElement.getAsJsonObject(); | ||
if (jsonObject.has("uri")) { | ||
JsonPrimitive uriPrimitive = jsonObject.getAsJsonPrimitive("uri"); | ||
if (!uriPrimitive.isString()) { | ||
throw new JsonParseException("Unexpected C2jXmlNamespace.uri type, expected a String!"); | ||
} | ||
retValue.setUri(uriPrimitive.getAsString()); | ||
} | ||
if (jsonObject.has("prefix")) { | ||
JsonPrimitive prefixPrimitive = jsonObject.getAsJsonPrimitive("prefix"); | ||
if (!prefixPrimitive.isString()) { | ||
throw new JsonParseException("Unexpected C2jXmlNamespace.prefix type, expected a String!"); | ||
} | ||
retValue.setPrefix(prefixPrimitive.getAsString()); | ||
} | ||
} else if (jsonElement.isJsonPrimitive() && jsonElement.getAsJsonPrimitive().isString()) { | ||
retValue.setUri(jsonElement.getAsJsonPrimitive().getAsString()); | ||
} else { | ||
throw new JsonParseException("Unexpected C2jXmlNamespace value, expected primitive Object or Primitive!"); | ||
} | ||
|
||
return retValue; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0. |
Oops, something went wrong.