java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.appsync.Values
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:49.582Z") @Stability(Experimental) public class Values extends software.amazon.jsii.JsiiObject
(experimental) Factory class for attribute value assignments.

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());
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
     
    protected
    Values(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    Values(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (experimental) Allows assigning a value to the specified attribute.
    (experimental) Treats the specified object as a map of assignments, where the property names represent attribute names.
    (experimental) Treats the specified object as a map of assignments, where the property names represent attribute names.

    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

    • Values

      protected Values(software.amazon.jsii.JsiiObjectRef objRef)
    • Values

      protected Values(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • Values

      @Stability(Experimental) public Values()
  • Method Details

    • attribute

      @Stability(Experimental) @NotNull public static AttributeValuesStep attribute(@NotNull String attr)
      (experimental) Allows assigning a value to the specified attribute.

      Parameters:
      attr - This parameter is required.
    • projecting

      @Stability(Experimental) @NotNull public static AttributeValues projecting(@Nullable String arg)
      (experimental) Treats the specified object as a map of assignments, where the property names represent attribute names.

      It’s opinionated about how it represents some of the nested objects: e.g., it will use lists (“L”) rather than sets (“SS”, “NS”, “BS”). By default it projects the argument container ("$ctx.args").

      Parameters:
      arg -
    • projecting

      @Stability(Experimental) @NotNull public static AttributeValues projecting()
      (experimental) Treats the specified object as a map of assignments, where the property names represent attribute names.

      It’s opinionated about how it represents some of the nested objects: e.g., it will use lists (“L”) rather than sets (“SS”, “NS”, “BS”). By default it projects the argument container ("$ctx.args").