@Generated(value="jsii-pacmak/1.58.0 (build f8ba112)", date="2022-05-20T22:20:07.055Z") public enum AuthorizationType extends java.lang.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(java.lang.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.
|
public static final AuthorizationType API_KEY
public static final AuthorizationType IAM
Can be used with Cognito Identity Pool federated credentials
public static final AuthorizationType USER_POOL
public static final AuthorizationType OIDC
public static final AuthorizationType LAMBDA
public static AuthorizationType[] values()
for (AuthorizationType c : AuthorizationType.values()) System.out.println(c);
public static AuthorizationType valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null