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
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package com.amazonaws.util.awsclientsmithygenerator.generators;

import com.google.common.base.CaseFormat;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import software.amazon.smithy.codegen.core.ImportContainer;
Expand Down Expand Up @@ -56,7 +57,9 @@ public CppImportContainer(String namespace) {
"Aws::Utils::Document", "aws/core/utils/Document.h",
"Aws::Utils::ByteBuffer", "aws/core/utils/Array.h");

dynamicHeaders.add(String.format("aws/%s/%sClient.h", c2jNamespace, clientNamespace));
dynamicHeaders.add(String.format("aws/%s/%sClient.h",
c2jNamespace,
CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, clientNamespace)));

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public interface GenericCodegenAdapter<SHAPE, DATA> {

public boolean isDoubleShape( SHAPE s);

public boolean isDocumentShape(SHAPE s);

public List<DATA> getList(DATA d);

public Map<String, DATA> getMap(DATA d);
Expand Down Expand Up @@ -213,8 +215,9 @@ else if(isDouble(value))
{
throw new RuntimeException("unsupported timestamp shape format");
}
}
else
} else if (isDocumentShape(shape)) {
functionName = String.format("Aws::Utils::Document{R\"({\"%s\", \"%s\"})\"}", key, value);
} else
{
throw new RuntimeException(String.format("shape not supported:%s",shape));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ public boolean isTimestampShape(Shape s)
return s.getType() == ShapeType.TIMESTAMP;
}

@Override
public boolean isDocumentShape(Shape s) {
return s.getType() == ShapeType.DOCUMENT;
}

@Override
public List<Node> getList(Node d)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
*/
package com.amazonaws.util.awsclientsmithygenerator.generators;

import software.amazon.smithy.codegen.core.SymbolWriter;
import com.google.common.base.CaseFormat;
import software.amazon.smithy.aws.smoketests.model.AwsVendorParams;
import software.amazon.smithy.codegen.core.SymbolWriter;

import java.util.List;
import java.util.Objects;

Expand Down Expand Up @@ -45,7 +47,9 @@ protected void defineTestCase(SmokeTestData test)
{
//declare test fixture
write("TEST_F($LSmokeTestSuite, $L )",clientNamespace, test.getTestcaseName()).write("{").indent().
write("Aws::$L::$LClientConfiguration clientConfiguration;", clientNamespace,clientNamespace);
write("Aws::$L::$LClientConfiguration clientConfiguration;",
clientNamespace,
CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, clientNamespace));
if(test.getConfig().getParams() instanceof AwsVendorParams)
{
AwsVendorParams configParams = (AwsVendorParams) test.getConfig().getParams();
Expand All @@ -60,7 +64,8 @@ protected void defineTestCase(SmokeTestData test)

if(Objects.equals(test.getAuth(), "sigv4") || Objects.equals(test.getAuth(), "sigv4a"))
{
write("auto clientSp = Aws::MakeShared<$LClient>(ALLOCATION_TAG, clientConfiguration);",clientNamespace);
write("auto clientSp = Aws::MakeShared<$LClient>(ALLOCATION_TAG, clientConfiguration);",
CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, clientNamespace));
}
//comments
if( !test.getTestDataCodeBlock().isEmpty() )
Expand Down