All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.cdklabs.awscdk.appsync.utils.Directive Maven / Gradle / Ivy

There is a newer version: 0.0.579
Show newest version
package io.github.cdklabs.awscdk.appsync.utils;

/**
 * Directives for types.
 * 

* i.e. @aws_iam or @aws_subscribe */ @javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-28T00:18:00.286Z") @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @software.amazon.jsii.Jsii(module = io.github.cdklabs.awscdk.appsync.utils.$Module.class, fqn = "awscdk-appsync-utils.Directive") public class Directive extends software.amazon.jsii.JsiiObject { protected Directive(final software.amazon.jsii.JsiiObjectRef objRef) { super(objRef); } protected Directive(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) { super(initializationMode); } /** * Add the @aws_api_key directive. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public static @org.jetbrains.annotations.NotNull io.github.cdklabs.awscdk.appsync.utils.Directive apiKey() { return software.amazon.jsii.JsiiObject.jsiiStaticCall(io.github.cdklabs.awscdk.appsync.utils.Directive.class, "apiKey", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.awscdk.appsync.utils.Directive.class)); } /** * Add the @aws_auth or @aws_cognito_user_pools directive. *

* @param groups the groups to allow access to. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public static @org.jetbrains.annotations.NotNull io.github.cdklabs.awscdk.appsync.utils.Directive cognito(final @org.jetbrains.annotations.NotNull java.lang.String... groups) { return software.amazon.jsii.JsiiObject.jsiiStaticCall(io.github.cdklabs.awscdk.appsync.utils.Directive.class, "cognito", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.awscdk.appsync.utils.Directive.class), java.util.Arrays.stream(groups).toArray(Object[]::new)); } /** * Add a custom directive. *

* @param statement

  • the directive statement to append.
This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public static @org.jetbrains.annotations.NotNull io.github.cdklabs.awscdk.appsync.utils.Directive custom(final @org.jetbrains.annotations.NotNull java.lang.String statement) { return software.amazon.jsii.JsiiObject.jsiiStaticCall(io.github.cdklabs.awscdk.appsync.utils.Directive.class, "custom", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.awscdk.appsync.utils.Directive.class), new Object[] { java.util.Objects.requireNonNull(statement, "statement is required") }); } /** * Add the @aws_iam directive. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public static @org.jetbrains.annotations.NotNull io.github.cdklabs.awscdk.appsync.utils.Directive iam() { return software.amazon.jsii.JsiiObject.jsiiStaticCall(io.github.cdklabs.awscdk.appsync.utils.Directive.class, "iam", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.awscdk.appsync.utils.Directive.class)); } /** * Add the @aws_oidc directive. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public static @org.jetbrains.annotations.NotNull io.github.cdklabs.awscdk.appsync.utils.Directive oidc() { return software.amazon.jsii.JsiiObject.jsiiStaticCall(io.github.cdklabs.awscdk.appsync.utils.Directive.class, "oidc", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.awscdk.appsync.utils.Directive.class)); } /** * Add the @aws_subscribe directive. *

* Only use for top level Subscription type. *

* @param mutations the mutation fields to link to. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public static @org.jetbrains.annotations.NotNull io.github.cdklabs.awscdk.appsync.utils.Directive subscribe(final @org.jetbrains.annotations.NotNull java.lang.String... mutations) { return software.amazon.jsii.JsiiObject.jsiiStaticCall(io.github.cdklabs.awscdk.appsync.utils.Directive.class, "subscribe", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.awscdk.appsync.utils.Directive.class), java.util.Arrays.stream(mutations).toArray(Object[]::new)); } /** * Generate the directive statement. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public @org.jetbrains.annotations.NotNull java.lang.String toString() { return software.amazon.jsii.Kernel.call(this, "toString", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); } /** * The authorization type of this directive. *

* Default: - not an authorization directive */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.appsync.AuthorizationType getMode() { return software.amazon.jsii.Kernel.get(this, "mode", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.appsync.AuthorizationType.class)); } /** * Mutation fields for a subscription directive. *

* Default: - not a subscription directive */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public @org.jetbrains.annotations.Nullable java.util.List getMutationFields() { return java.util.Optional.ofNullable((java.util.List)(software.amazon.jsii.Kernel.get(this, "mutationFields", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class))))).map(java.util.Collections::unmodifiableList).orElse(null); } /** * the authorization modes for this intermediate type. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) protected @org.jetbrains.annotations.Nullable java.util.List getModes() { return java.util.Optional.ofNullable((java.util.List)(software.amazon.jsii.Kernel.get(this, "modes", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.appsync.AuthorizationType.class))))).map(java.util.Collections::unmodifiableList).orElse(null); } /** * the authorization modes for this intermediate type. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) protected void setModes(final @org.jetbrains.annotations.Nullable java.util.List value) { software.amazon.jsii.Kernel.set(this, "modes", value); } }