-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
223 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
...java/software/amazon/smithy/typescript/codegen/protocols/cbor/CborMemberDeserVisitor.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,28 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package software.amazon.smithy.typescript.codegen.protocols.cbor; | ||
|
||
import software.amazon.smithy.model.traits.TimestampFormatTrait; | ||
import software.amazon.smithy.typescript.codegen.integration.DocumentMemberDeserVisitor; | ||
import software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator; | ||
|
||
public class CborMemberDeserVisitor extends DocumentMemberDeserVisitor { | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param context The generation context. | ||
* @param dataSource The in-code location of the data to provide an output of | ||
* ({@code output.foo}, {@code entry}, etc.) | ||
* @param defaultTimestampFormat The default timestamp format used in absence | ||
* of a TimestampFormat trait. | ||
*/ | ||
public CborMemberDeserVisitor(ProtocolGenerator.GenerationContext context, | ||
String dataSource, | ||
TimestampFormatTrait.Format defaultTimestampFormat) { | ||
super(context, dataSource, defaultTimestampFormat); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...n/java/software/amazon/smithy/typescript/codegen/protocols/cbor/CborMemberSerVisitor.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,28 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package software.amazon.smithy.typescript.codegen.protocols.cbor; | ||
|
||
import software.amazon.smithy.model.traits.TimestampFormatTrait; | ||
import software.amazon.smithy.typescript.codegen.integration.DocumentMemberSerVisitor; | ||
import software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator; | ||
|
||
public class CborMemberSerVisitor extends DocumentMemberSerVisitor { | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param context The generation context. | ||
* @param dataSource The in-code location of the data to provide an input of | ||
* ({@code input.foo}, {@code entry}, etc.) | ||
* @param defaultTimestampFormat The default timestamp format used in absence | ||
* of a TimestampFormat trait. | ||
*/ | ||
public CborMemberSerVisitor(ProtocolGenerator.GenerationContext context, | ||
String dataSource, | ||
TimestampFormatTrait.Format defaultTimestampFormat) { | ||
super(context, dataSource, defaultTimestampFormat); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
.../java/software/amazon/smithy/typescript/codegen/protocols/cbor/CborShapeDeserVisitor.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,46 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package software.amazon.smithy.typescript.codegen.protocols.cbor; | ||
|
||
import software.amazon.smithy.model.shapes.CollectionShape; | ||
import software.amazon.smithy.model.shapes.DocumentShape; | ||
import software.amazon.smithy.model.shapes.MapShape; | ||
import software.amazon.smithy.model.shapes.StructureShape; | ||
import software.amazon.smithy.model.shapes.UnionShape; | ||
import software.amazon.smithy.typescript.codegen.integration.DocumentShapeDeserVisitor; | ||
import software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator; | ||
|
||
public class CborShapeDeserVisitor extends DocumentShapeDeserVisitor { | ||
|
||
public CborShapeDeserVisitor(ProtocolGenerator.GenerationContext context) { | ||
super(context); | ||
} | ||
|
||
@Override | ||
protected void deserializeCollection(ProtocolGenerator.GenerationContext context, CollectionShape shape) { | ||
|
||
} | ||
|
||
@Override | ||
protected void deserializeDocument(ProtocolGenerator.GenerationContext context, DocumentShape shape) { | ||
|
||
} | ||
|
||
@Override | ||
protected void deserializeMap(ProtocolGenerator.GenerationContext context, MapShape shape) { | ||
|
||
} | ||
|
||
@Override | ||
protected void deserializeStructure(ProtocolGenerator.GenerationContext context, StructureShape shape) { | ||
|
||
} | ||
|
||
@Override | ||
protected void deserializeUnion(ProtocolGenerator.GenerationContext context, UnionShape shape) { | ||
|
||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
...in/java/software/amazon/smithy/typescript/codegen/protocols/cbor/CborShapeSerVisitor.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,46 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package software.amazon.smithy.typescript.codegen.protocols.cbor; | ||
|
||
import software.amazon.smithy.model.shapes.CollectionShape; | ||
import software.amazon.smithy.model.shapes.DocumentShape; | ||
import software.amazon.smithy.model.shapes.MapShape; | ||
import software.amazon.smithy.model.shapes.StructureShape; | ||
import software.amazon.smithy.model.shapes.UnionShape; | ||
import software.amazon.smithy.typescript.codegen.integration.DocumentShapeSerVisitor; | ||
import software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator; | ||
|
||
public class CborShapeSerVisitor extends DocumentShapeSerVisitor { | ||
|
||
public CborShapeSerVisitor(ProtocolGenerator.GenerationContext context) { | ||
super(context); | ||
} | ||
|
||
@Override | ||
protected void serializeCollection(ProtocolGenerator.GenerationContext context, CollectionShape shape) { | ||
|
||
} | ||
|
||
@Override | ||
protected void serializeDocument(ProtocolGenerator.GenerationContext context, DocumentShape shape) { | ||
|
||
} | ||
|
||
@Override | ||
protected void serializeMap(ProtocolGenerator.GenerationContext context, MapShape shape) { | ||
|
||
} | ||
|
||
@Override | ||
protected void serializeStructure(ProtocolGenerator.GenerationContext context, StructureShape shape) { | ||
|
||
} | ||
|
||
@Override | ||
protected void serializeUnion(ProtocolGenerator.GenerationContext context, UnionShape shape) { | ||
|
||
} | ||
} |
75 changes: 75 additions & 0 deletions
75
...c/main/java/software/amazon/smithy/typescript/codegen/protocols/cbor/SmithyRpcV2Cbor.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,75 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package software.amazon.smithy.typescript.codegen.protocols.cbor; | ||
|
||
import java.util.Set; | ||
import software.amazon.smithy.model.shapes.OperationShape; | ||
import software.amazon.smithy.model.shapes.Shape; | ||
import software.amazon.smithy.model.shapes.ShapeId; | ||
import software.amazon.smithy.model.shapes.StructureShape; | ||
import software.amazon.smithy.typescript.codegen.integration.HttpRpcProtocolGenerator; | ||
import software.amazon.smithy.utils.SmithyInternalApi; | ||
|
||
|
||
/** | ||
* Generator for Smithy RPCv2 CBOR. | ||
*/ | ||
@SmithyInternalApi | ||
public class SmithyRpcV2Cbor extends HttpRpcProtocolGenerator { | ||
|
||
public SmithyRpcV2Cbor() { | ||
super(true); | ||
} | ||
|
||
@Override | ||
protected String getDocumentContentType() { | ||
return ""; | ||
} | ||
|
||
@Override | ||
protected void generateDocumentBodyShapeSerializers(GenerationContext generationContext, Set<Shape> set) { | ||
|
||
} | ||
|
||
@Override | ||
protected void generateDocumentBodyShapeDeserializers(GenerationContext generationContext, Set<Shape> set) { | ||
|
||
} | ||
|
||
@Override | ||
protected String getOperationPath(GenerationContext generationContext, OperationShape operationShape) { | ||
return ""; | ||
} | ||
|
||
@Override | ||
protected void serializeInputDocument(GenerationContext generationContext, | ||
OperationShape operationShape, | ||
StructureShape structureShape) { | ||
|
||
} | ||
|
||
@Override | ||
protected void writeErrorCodeParser(GenerationContext generationContext) { | ||
|
||
} | ||
|
||
@Override | ||
protected void deserializeOutputDocument(GenerationContext generationContext, | ||
OperationShape operationShape, | ||
StructureShape structureShape) { | ||
|
||
} | ||
|
||
@Override | ||
public ShapeId getProtocol() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public void generateProtocolTests(GenerationContext generationContext) { | ||
|
||
} | ||
} |