io.github.cdklabs.awscdk.appsync.utils.Field Maven / Gradle / Ivy
Show all versions of awscdk-appsync-utils Show documentation
package io.github.cdklabs.awscdk.appsync.utils;
/**
* Fields build upon Graphql Types and provide typing and arguments.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-28T00:18:00.290Z")
@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.Field")
public class Field extends io.github.cdklabs.awscdk.appsync.utils.GraphqlType implements io.github.cdklabs.awscdk.appsync.utils.IField {
protected Field(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected Field(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param options This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Field(final @org.jetbrains.annotations.NotNull io.github.cdklabs.awscdk.appsync.utils.FieldOptions options) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(options, "options is required") });
}
/**
* Generate the args string of this resolvable field.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public @org.jetbrains.annotations.NotNull java.lang.String argsToString() {
return software.amazon.jsii.Kernel.call(this, "argsToString", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* Generate the directives for this field.
*
* @param modes
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public @org.jetbrains.annotations.NotNull java.lang.String directivesToString(final @org.jetbrains.annotations.Nullable java.util.List modes) {
return software.amazon.jsii.Kernel.call(this, "directivesToString", software.amazon.jsii.NativeType.forClass(java.lang.String.class), new Object[] { modes });
}
/**
* Generate the directives for this field.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public @org.jetbrains.annotations.NotNull java.lang.String directivesToString() {
return software.amazon.jsii.Kernel.call(this, "directivesToString", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* The options for this field.
*
* Default: - no arguments
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.Nullable io.github.cdklabs.awscdk.appsync.utils.ResolvableFieldOptions getFieldOptions() {
return software.amazon.jsii.Kernel.get(this, "fieldOptions", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.awscdk.appsync.utils.ResolvableFieldOptions.class));
}
/**
* A fluent builder for {@link io.github.cdklabs.awscdk.appsync.utils.Field}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static Builder create() {
return new Builder();
}
private final io.github.cdklabs.awscdk.appsync.utils.FieldOptions.Builder options;
private Builder() {
this.options = new io.github.cdklabs.awscdk.appsync.utils.FieldOptions.Builder();
}
/**
* The return type for this field.
*
* @return {@code this}
* @param returnType The return type for this field. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder returnType(final io.github.cdklabs.awscdk.appsync.utils.GraphqlType returnType) {
this.options.returnType(returnType);
return this;
}
/**
* The arguments for this field.
*
* i.e. type Example (first: String second: String) {}
*
*
* - where 'first' and 'second' are key values for args
* and 'String' is the GraphqlType
*
*
* Default: - no arguments
*
* @return {@code this}
* @param args The arguments for this field. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder args(final java.util.Map args) {
this.options.args(args);
return this;
}
/**
* the directives for this field.
*
* Default: - no directives
*
* @return {@code this}
* @param directives the directives for this field. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder directives(final java.util.List extends io.github.cdklabs.awscdk.appsync.utils.Directive> directives) {
this.options.directives(directives);
return this;
}
/**
* @return a newly built instance of {@link io.github.cdklabs.awscdk.appsync.utils.Field}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public io.github.cdklabs.awscdk.appsync.utils.Field build() {
return new io.github.cdklabs.awscdk.appsync.utils.Field(
this.options.build()
);
}
}
}