Class MappingTemplate
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.appsync.MappingTemplate
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:49.549Z")
@Stability(Experimental)
public abstract class MappingTemplate
extends software.amazon.jsii.JsiiObject
(experimental) MappingTemplates for AppSync resolvers.
Example:
GraphqlApi api; MappingTemplate dummyRequest; MappingTemplate dummyResponse; ObjectType info = ObjectType.Builder.create("Info") .definition(Map.of( "node", ResolvableField.Builder.create() .returnType(GraphqlType.string()) .args(Map.of( "id", GraphqlType.string())) .dataSource(api.addNoneDataSource("none")) .requestMappingTemplate(dummyRequest) .responseMappingTemplate(dummyResponse) .build())) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Constructor Summary
ModifierConstructorDescriptionprotected
protected
MappingTemplate
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
MappingTemplate
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic MappingTemplate
dynamoDbDeleteItem
(String keyName, String idArg) (experimental) Mapping template to delete a single item from a DynamoDB table.static MappingTemplate
dynamoDbGetItem
(String keyName, String idArg) (experimental) Mapping template to get a single item from a DynamoDB table.static MappingTemplate
dynamoDbPutItem
(PrimaryKey key, AttributeValues values) (experimental) Mapping template to save a single item to a DynamoDB table.static MappingTemplate
dynamoDbQuery
(KeyCondition cond) (experimental) Mapping template to query a set of items from a DynamoDB table.static MappingTemplate
dynamoDbQuery
(KeyCondition cond, String indexName) (experimental) Mapping template to query a set of items from a DynamoDB table.static MappingTemplate
(experimental) Mapping template for a single result item from DynamoDB.static MappingTemplate
(experimental) Mapping template for a result list from DynamoDB.static MappingTemplate
(experimental) Mapping template to scan a DynamoDB table to fetch all entries.static MappingTemplate
(experimental) Create a mapping template from the given file.static MappingTemplate
fromString
(String template) (experimental) Create a mapping template from the given string.static MappingTemplate
(experimental) Mapping template to invoke a Lambda function.static MappingTemplate
lambdaRequest
(String payload) (experimental) Mapping template to invoke a Lambda function.static MappingTemplate
lambdaRequest
(String payload, String operation) (experimental) Mapping template to invoke a Lambda function.static MappingTemplate
(experimental) Mapping template to return the Lambda result to the caller.abstract String
(experimental) this is called to render the mapping template to a VTL string.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
MappingTemplate
protected MappingTemplate(software.amazon.jsii.JsiiObjectRef objRef) -
MappingTemplate
protected MappingTemplate(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
MappingTemplate
@Stability(Experimental) protected MappingTemplate()
-
-
Method Details
-
dynamoDbDeleteItem
@Stability(Experimental) @NotNull public static MappingTemplate dynamoDbDeleteItem(@NotNull String keyName, @NotNull String idArg) (experimental) Mapping template to delete a single item from a DynamoDB table.- Parameters:
keyName
- the name of the hash key field. This parameter is required.idArg
- the name of the Mutation argument. This parameter is required.
-
dynamoDbGetItem
@Stability(Experimental) @NotNull public static MappingTemplate dynamoDbGetItem(@NotNull String keyName, @NotNull String idArg) (experimental) Mapping template to get a single item from a DynamoDB table.- Parameters:
keyName
- the name of the hash key field. This parameter is required.idArg
- the name of the Query argument. This parameter is required.
-
dynamoDbPutItem
@Stability(Experimental) @NotNull public static MappingTemplate dynamoDbPutItem(@NotNull PrimaryKey key, @NotNull AttributeValues values) (experimental) Mapping template to save a single item to a DynamoDB table.- Parameters:
key
- the assigment of Mutation values to the primary key. This parameter is required.values
- the assignment of Mutation values to the table attributes. This parameter is required.
-
dynamoDbQuery
@Stability(Experimental) @NotNull public static MappingTemplate dynamoDbQuery(@NotNull KeyCondition cond, @Nullable String indexName) (experimental) Mapping template to query a set of items from a DynamoDB table.- Parameters:
cond
- the key condition for the query. This parameter is required.indexName
-
-
dynamoDbQuery
@Stability(Experimental) @NotNull public static MappingTemplate dynamoDbQuery(@NotNull KeyCondition cond) (experimental) Mapping template to query a set of items from a DynamoDB table.- Parameters:
cond
- the key condition for the query. This parameter is required.
-
dynamoDbResultItem
(experimental) Mapping template for a single result item from DynamoDB. -
dynamoDbResultList
(experimental) Mapping template for a result list from DynamoDB. -
dynamoDbScanTable
(experimental) Mapping template to scan a DynamoDB table to fetch all entries. -
fromFile
(experimental) Create a mapping template from the given file.- Parameters:
fileName
- This parameter is required.
-
fromString
@Stability(Experimental) @NotNull public static MappingTemplate fromString(@NotNull String template) (experimental) Create a mapping template from the given string.- Parameters:
template
- This parameter is required.
-
lambdaRequest
@Stability(Experimental) @NotNull public static MappingTemplate lambdaRequest(@Nullable String payload, @Nullable String operation) (experimental) Mapping template to invoke a Lambda function.- Parameters:
payload
- the VTL template snippet of the payload to send to the lambda.operation
- the type of operation AppSync should perform on the data source.
-
lambdaRequest
@Stability(Experimental) @NotNull public static MappingTemplate lambdaRequest(@Nullable String payload) (experimental) Mapping template to invoke a Lambda function.- Parameters:
payload
- the VTL template snippet of the payload to send to the lambda.
-
lambdaRequest
(experimental) Mapping template to invoke a Lambda function. -
lambdaResult
(experimental) Mapping template to return the Lambda result to the caller. -
renderTemplate
(experimental) this is called to render the mapping template to a VTL string.
-