Class EnumType

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:49.494Z") @Stability(Experimental) public class EnumType extends software.amazon.jsii.JsiiObject implements IIntermediateType
(experimental) Enum Types are abstract types that includes a set of fields that represent the strings this type can create.

Example:

 GraphqlApi api;
 EnumType episode = EnumType.Builder.create("Episode")
         .definition(List.of("NEWHOPE", "EMPIRE", "JEDI"))
         .build();
 api.addType(episode);
 
  • Constructor Details

    • EnumType

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

      protected EnumType(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • EnumType

      @Stability(Experimental) public EnumType(@NotNull String name, @NotNull EnumTypeOptions options)
      Parameters:
      name - This parameter is required.
      options - This parameter is required.
  • Method Details

    • addField

      @Stability(Experimental) public void addField(@NotNull AddFieldOptions options)
      (experimental) Add a field to this Enum Type.

      To add a field to this Enum Type, you must only configure addField with the fieldName options.

      Specified by:
      addField in interface IIntermediateType
      Parameters:
      options - the options to add a field. This parameter is required.
    • attribute

      @Stability(Experimental) @NotNull public GraphqlType attribute(@Nullable BaseTypeOptions options)
      (experimental) Create an GraphQL Type representing this Enum Type.

      Specified by:
      attribute in interface IIntermediateType
      Parameters:
      options -
    • attribute

      @Stability(Experimental) @NotNull public GraphqlType attribute()
      (experimental) Create an GraphQL Type representing this Enum Type.
      Specified by:
      attribute in interface IIntermediateType
    • toString

      @Stability(Experimental) @NotNull public String toString()
      (experimental) Generate the string of this enum type.
      Specified by:
      toString in interface IIntermediateType
      Overrides:
      toString in class Object
    • getDefinition

      @Stability(Experimental) @NotNull public Map<String,IField> getDefinition()
      (experimental) the attributes of this type.
      Specified by:
      getDefinition in interface IIntermediateType
    • getName

      @Stability(Experimental) @NotNull public String getName()
      (experimental) the name of this type.
      Specified by:
      getName in interface IIntermediateType
    • 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.