@Generated(value="jsii-pacmak/1.50.0 (build d1830a4)", date="2022-01-04T15:39:02.997Z") @Stability(value=Experimental) public enum AuthorizationType extends Enum<AuthorizationType>
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());
| Enum Constant and Description |
|---|
API_KEY
(experimental) API Key authorization type.
|
IAM
(experimental) AWS IAM authorization type.
|
LAMBDA
(experimental) Lambda authorization type.
|
OIDC
(experimental) OpenID Connect authorization type.
|
USER_POOL
(experimental) Cognito User Pool authorization type.
|
| Modifier and Type | Method and Description |
|---|---|
static AuthorizationType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static AuthorizationType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
@Stability(value=Experimental) public static final AuthorizationType API_KEY
@Stability(value=Experimental) public static final AuthorizationType IAM
Can be used with Cognito Identity Pool federated credentials
@Stability(value=Experimental) public static final AuthorizationType USER_POOL
@Stability(value=Experimental) public static final AuthorizationType OIDC
@Stability(value=Experimental) public static final AuthorizationType LAMBDA
public static AuthorizationType[] values()
for (AuthorizationType c : AuthorizationType.values()) System.out.println(c);
public static AuthorizationType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2022. All rights reserved.