@Generated(value="jsii-pacmak/1.50.0 (build d1830a4)", date="2022-01-04T15:39:02.992Z") @Stability(value=Experimental) public class AttributeValues extends software.amazon.jsii.JsiiObject
Example:
GraphqlApi api = GraphqlApi.Builder.create(this, "Api")
.name("demo")
.schema(Schema.fromAsset(join(__dirname, "schema.graphql")))
.authorizationConfig(AuthorizationConfig.builder()
.defaultAuthorization(AuthorizationMode.builder()
.authorizationType(AuthorizationType.IAM)
.build())
.build())
.xrayEnabled(true)
.build();
Table demoTable = Table.Builder.create(this, "DemoTable")
.partitionKey(Attribute.builder()
.name("id")
.type(AttributeType.STRING)
.build())
.build();
DynamoDbDataSource demoDS = api.addDynamoDbDataSource("demoDataSource", demoTable);
// Resolver for the Query "getDemos" that scans the DynamoDb table and returns the entire list.
demoDS.createResolver(BaseResolverProps.builder()
.typeName("Query")
.fieldName("getDemos")
.requestMappingTemplate(MappingTemplate.dynamoDbScanTable())
.responseMappingTemplate(MappingTemplate.dynamoDbResultList())
.build());
// Resolver for the Mutation "addDemo" that puts the item into the DynamoDb table.
demoDS.createResolver(BaseResolverProps.builder()
.typeName("Mutation")
.fieldName("addDemo")
.requestMappingTemplate(MappingTemplate.dynamoDbPutItem(PrimaryKey.partition("id").auto(), Values.projecting("input")))
.responseMappingTemplate(MappingTemplate.dynamoDbResultItem())
.build());
| Modifier | Constructor and Description |
|---|---|
protected |
AttributeValues(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
AttributeValues(software.amazon.jsii.JsiiObjectRef objRef) |
|
AttributeValues(String container) |
|
AttributeValues(String container,
List<Assign> assignments) |
| Modifier and Type | Method and Description |
|---|---|
AttributeValuesStep |
attribute(String attr)
(experimental) Allows assigning a value to the specified attribute.
|
String |
renderTemplate()
(experimental) Renders the attribute value assingments to a VTL string.
|
String |
renderVariables()
(experimental) Renders the variables required for `renderTemplate`.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected AttributeValues(software.amazon.jsii.JsiiObjectRef objRef)
protected AttributeValues(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental)
public AttributeValues(@NotNull
String container,
@Nullable
List<Assign> assignments)
container - This parameter is required.assignments - @Stability(value=Experimental)
public AttributeValues(@NotNull
String container)
container - This parameter is required.@Stability(value=Experimental) @NotNull public AttributeValuesStep attribute(@NotNull String attr)
attr - This parameter is required.@Stability(value=Experimental) @NotNull public String renderTemplate()
@Stability(value=Experimental) @NotNull public String renderVariables()
Copyright © 2022. All rights reserved.