Class Directive

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:49.485Z") @Stability(Experimental) public class Directive extends software.amazon.jsii.JsiiObject
(experimental) Directives for types.

i.e. @aws_iam or @aws_subscribe

Example:

 GraphqlApi api;
 InterfaceType film;
 api.addSubscription("addedFilm", Field.Builder.create()
         .returnType(film.attribute())
         .args(Map.of("id", GraphqlType.id(BaseTypeOptions.builder().isRequired(true).build())))
         .directives(List.of(Directive.subscribe("addFilm")))
         .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
    Directive(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    Directive(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Directive
    (experimental) Add the @aws_api_key directive.
    static Directive
    cognito(@NotNull String... groups)
    (experimental) Add the @aws_auth or @aws_cognito_user_pools directive.
    static Directive
    custom(String statement)
    (experimental) Add a custom directive.
    (experimental) The authorization type of this directive.
    (experimental) the authorization modes for this intermediate type.
    (experimental) Mutation fields for a subscription directive.
    static Directive
    iam()
    (experimental) Add the @aws_iam directive.
    static Directive
    (experimental) Add the @aws_oidc directive.
    protected void
    (experimental) the authorization modes for this intermediate type.
    static Directive
    subscribe(@NotNull String... mutations)
    (experimental) Add the @aws_subscribe directive.
    (experimental) Generate the directive statement.

    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, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • Directive

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

      protected Directive(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
  • Method Details

    • apiKey

      @Stability(Experimental) @NotNull public static Directive apiKey()
      (experimental) Add the @aws_api_key directive.
    • cognito

      @Stability(Experimental) @NotNull public static Directive cognito(@NotNull @NotNull String... groups)
      (experimental) Add the @aws_auth or @aws_cognito_user_pools directive.

      Parameters:
      groups - the groups to allow access to. This parameter is required.
    • custom

      @Stability(Experimental) @NotNull public static Directive custom(@NotNull String statement)
      (experimental) Add a custom directive.

      Parameters:
      statement -
      • the directive statement to append.
      This parameter is required.
    • iam

      @Stability(Experimental) @NotNull public static Directive iam()
      (experimental) Add the @aws_iam directive.
    • oidc

      @Stability(Experimental) @NotNull public static Directive oidc()
      (experimental) Add the @aws_oidc directive.
    • subscribe

      @Stability(Experimental) @NotNull public static Directive subscribe(@NotNull @NotNull String... mutations)
      (experimental) Add the @aws_subscribe directive.

      Only use for top level Subscription type.

      Parameters:
      mutations - the mutation fields to link to. This parameter is required.
    • toString

      @Stability(Experimental) @NotNull public String toString()
      (experimental) Generate the directive statement.
      Overrides:
      toString in class Object
    • getMode

      @Stability(Experimental) @Nullable public AuthorizationType getMode()
      (experimental) The authorization type of this directive.

      Default: - not an authorization directive

    • getMutationFields

      @Stability(Experimental) @Nullable public List<String> getMutationFields()
      (experimental) Mutation fields for a subscription directive.

      Default: - not a subscription directive

    • getModes

      @Stability(Experimental) @Nullable protected List<AuthorizationType> getModes()
      (experimental) the authorization modes for this intermediate type.
    • setModes

      @Stability(Experimental) protected void setModes(@Nullable List<AuthorizationType> value)
      (experimental) the authorization modes for this intermediate type.