Show / Hide Table of Contents

Class Values

(experimental) Factory class for attribute value assignments.

Inheritance
System.Object
Values
Namespace: Amazon.CDK.AWS.AppSync
Assembly: Amazon.CDK.AWS.AppSync.dll
Syntax (csharp)
public class Values : DeputyBase
Syntax (vb)
Public Class Values
    Inherits DeputyBase
Remarks

Stability: Experimental

ExampleMetadata: infused

Examples
var api = new GraphqlApi(this, "Api", new GraphqlApiProps {
    Name = "demo",
    Schema = Schema.FromAsset(Join(__dirname, "schema.graphql")),
    AuthorizationConfig = new AuthorizationConfig {
        DefaultAuthorization = new AuthorizationMode {
            AuthorizationType = AuthorizationType.IAM
        }
    },
    XrayEnabled = true
});

var demoTable = new Table(this, "DemoTable", new TableProps {
    PartitionKey = new Attribute {
        Name = "id",
        Type = AttributeType.STRING
    }
});

var demoDS = api.AddDynamoDbDataSource("demoDataSource", demoTable);

// Resolver for the Query "getDemos" that scans the DynamoDb table and returns the entire list.
demoDS.CreateResolver(new BaseResolverProps {
    TypeName = "Query",
    FieldName = "getDemos",
    RequestMappingTemplate = MappingTemplate.DynamoDbScanTable(),
    ResponseMappingTemplate = MappingTemplate.DynamoDbResultList()
});

// Resolver for the Mutation "addDemo" that puts the item into the DynamoDb table.
demoDS.CreateResolver(new BaseResolverProps {
    TypeName = "Mutation",
    FieldName = "addDemo",
    RequestMappingTemplate = MappingTemplate.DynamoDbPutItem(PrimaryKey.Partition("id").Auto(), Values.Projecting("input")),
    ResponseMappingTemplate = MappingTemplate.DynamoDbResultItem()
});

Synopsis

Constructors

Values()
Values(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

Values(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

Methods

Attribute(String)

(experimental) Allows assigning a value to the specified attribute.

Projecting(String)

(experimental) Treats the specified object as a map of assignments, where the property names represent attribute names.

Constructors

Values()

public Values()
Remarks

Stability: Experimental

Values(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

protected Values(ByRefValue reference)
Parameters
reference Amazon.JSII.Runtime.Deputy.ByRefValue

The Javascript-owned object reference

Values(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

protected Values(DeputyBase.DeputyProps props)
Parameters
props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps

The deputy props

Methods

Attribute(String)

(experimental) Allows assigning a value to the specified attribute.

public static AttributeValuesStep Attribute(string attr)
Parameters
attr System.String
Returns

AttributeValuesStep

Remarks

Stability: Experimental

Projecting(String)

(experimental) Treats the specified object as a map of assignments, where the property names represent attribute names.

public static AttributeValues Projecting(string arg = null)
Parameters
arg System.String
Returns

AttributeValues

Remarks

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").

Stability: Experimental

Back to top Generated by DocFX