software.amazon.awscdk.services.appsync.AddFieldOptions Maven / Gradle / Ivy
Show all versions of appsync Show documentation
package software.amazon.awscdk.services.appsync;
/**
* (experimental) The options to add a field to an Intermediate Type.
*
* Example:
*
*
* // The code below shows an example of how to instantiate this type.
* // The values are placeholders you should change.
* import software.amazon.awscdk.services.appsync.*;
* Field field;
* AddFieldOptions addFieldOptions = AddFieldOptions.builder()
* .field(field)
* .fieldName("fieldName")
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.72.0 (build 4b8828b)", date = "2023-01-03T16:22:41.699Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.appsync.$Module.class, fqn = "@aws-cdk/aws-appsync.AddFieldOptions")
@software.amazon.jsii.Jsii.Proxy(AddFieldOptions.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface AddFieldOptions extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) The resolvable field to add.
*
* This option must be configured for Object, Interface,
* Input and Union Types.
*
* Default: - no IField
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.appsync.IField getField() {
return null;
}
/**
* (experimental) The name of the field.
*
* This option must be configured for Object, Interface,
* Input and Enum Types.
*
* Default: - no fieldName
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getFieldName() {
return null;
}
/**
* @return a {@link Builder} of {@link AddFieldOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link AddFieldOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
software.amazon.awscdk.services.appsync.IField field;
java.lang.String fieldName;
/**
* Sets the value of {@link AddFieldOptions#getField}
* @param field The resolvable field to add.
* This option must be configured for Object, Interface,
* Input and Union Types.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder field(software.amazon.awscdk.services.appsync.IField field) {
this.field = field;
return this;
}
/**
* Sets the value of {@link AddFieldOptions#getFieldName}
* @param fieldName The name of the field.
* This option must be configured for Object, Interface,
* Input and Enum Types.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder fieldName(java.lang.String fieldName) {
this.fieldName = fieldName;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link AddFieldOptions}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public AddFieldOptions build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link AddFieldOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements AddFieldOptions {
private final software.amazon.awscdk.services.appsync.IField field;
private final java.lang.String fieldName;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.field = software.amazon.jsii.Kernel.get(this, "field", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.appsync.IField.class));
this.fieldName = software.amazon.jsii.Kernel.get(this, "fieldName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.field = builder.field;
this.fieldName = builder.fieldName;
}
@Override
public final software.amazon.awscdk.services.appsync.IField getField() {
return this.field;
}
@Override
public final java.lang.String getFieldName() {
return this.fieldName;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
if (this.getField() != null) {
data.set("field", om.valueToTree(this.getField()));
}
if (this.getFieldName() != null) {
data.set("fieldName", om.valueToTree(this.getFieldName()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk/aws-appsync.AddFieldOptions"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AddFieldOptions.Jsii$Proxy that = (AddFieldOptions.Jsii$Proxy) o;
if (this.field != null ? !this.field.equals(that.field) : that.field != null) return false;
return this.fieldName != null ? this.fieldName.equals(that.fieldName) : that.fieldName == null;
}
@Override
public final int hashCode() {
int result = this.field != null ? this.field.hashCode() : 0;
result = 31 * result + (this.fieldName != null ? this.fieldName.hashCode() : 0);
return result;
}
}
}