io.github.cdklabs.awscdk.appsync.utils.ResolvableFieldOptions Maven / Gradle / Ivy
Show all versions of awscdk-appsync-utils Show documentation
package io.github.cdklabs.awscdk.appsync.utils;
/**
* Properties for configuring a resolvable field.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-28T00:18:00.312Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.awscdk.appsync.utils.$Module.class, fqn = "awscdk-appsync-utils.ResolvableFieldOptions")
@software.amazon.jsii.Jsii.Proxy(ResolvableFieldOptions.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface ResolvableFieldOptions extends software.amazon.jsii.JsiiSerializable, io.github.cdklabs.awscdk.appsync.utils.FieldOptions {
/**
* The caching configuration for this resolver.
*
* Default: - No caching configuration
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.appsync.CachingConfig getCachingConfig() {
return null;
}
/**
* The function code.
*
* Default: - no code is used
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.appsync.Code getCode() {
return null;
}
/**
* The data source creating linked to this resolvable field.
*
* Default: - no data source
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.appsync.BaseDataSource getDataSource() {
return null;
}
/**
* The maximum number of elements per batch, when using batch invoke.
*
* Default: - No max batch size
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Number getMaxBatchSize() {
return null;
}
/**
* configuration of the pipeline resolver.
*
* Default: - no pipeline resolver configuration
* An empty array | undefined sets resolver to be of kind, unit
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.List getPipelineConfig() {
return null;
}
/**
* The request mapping template for this resolver.
*
* Default: - No mapping template
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.appsync.MappingTemplate getRequestMappingTemplate() {
return null;
}
/**
* The response mapping template for this resolver.
*
* Default: - No mapping template
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.appsync.MappingTemplate getResponseMappingTemplate() {
return null;
}
/**
* The functions runtime.
*
* Default: - no function runtime, VTL mapping templates used
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.appsync.FunctionRuntime getRuntime() {
return null;
}
/**
* @return a {@link Builder} of {@link ResolvableFieldOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link ResolvableFieldOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
software.amazon.awscdk.services.appsync.CachingConfig cachingConfig;
software.amazon.awscdk.services.appsync.Code code;
software.amazon.awscdk.services.appsync.BaseDataSource dataSource;
java.lang.Number maxBatchSize;
java.util.List pipelineConfig;
software.amazon.awscdk.services.appsync.MappingTemplate requestMappingTemplate;
software.amazon.awscdk.services.appsync.MappingTemplate responseMappingTemplate;
software.amazon.awscdk.services.appsync.FunctionRuntime runtime;
io.github.cdklabs.awscdk.appsync.utils.GraphqlType returnType;
java.util.Map args;
java.util.List directives;
/**
* Sets the value of {@link ResolvableFieldOptions#getCachingConfig}
* @param cachingConfig The caching configuration for this resolver.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder cachingConfig(software.amazon.awscdk.services.appsync.CachingConfig cachingConfig) {
this.cachingConfig = cachingConfig;
return this;
}
/**
* Sets the value of {@link ResolvableFieldOptions#getCode}
* @param code The function code.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder code(software.amazon.awscdk.services.appsync.Code code) {
this.code = code;
return this;
}
/**
* Sets the value of {@link ResolvableFieldOptions#getDataSource}
* @param dataSource The data source creating linked to this resolvable field.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder dataSource(software.amazon.awscdk.services.appsync.BaseDataSource dataSource) {
this.dataSource = dataSource;
return this;
}
/**
* Sets the value of {@link ResolvableFieldOptions#getMaxBatchSize}
* @param maxBatchSize The maximum number of elements per batch, when using batch invoke.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder maxBatchSize(java.lang.Number maxBatchSize) {
this.maxBatchSize = maxBatchSize;
return this;
}
/**
* Sets the value of {@link ResolvableFieldOptions#getPipelineConfig}
* @param pipelineConfig configuration of the pipeline resolver.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@SuppressWarnings("unchecked")
public Builder pipelineConfig(java.util.List extends software.amazon.awscdk.services.appsync.IAppsyncFunction> pipelineConfig) {
this.pipelineConfig = (java.util.List)pipelineConfig;
return this;
}
/**
* Sets the value of {@link ResolvableFieldOptions#getRequestMappingTemplate}
* @param requestMappingTemplate The request mapping template for this resolver.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder requestMappingTemplate(software.amazon.awscdk.services.appsync.MappingTemplate requestMappingTemplate) {
this.requestMappingTemplate = requestMappingTemplate;
return this;
}
/**
* Sets the value of {@link ResolvableFieldOptions#getResponseMappingTemplate}
* @param responseMappingTemplate The response mapping template for this resolver.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder responseMappingTemplate(software.amazon.awscdk.services.appsync.MappingTemplate responseMappingTemplate) {
this.responseMappingTemplate = responseMappingTemplate;
return this;
}
/**
* Sets the value of {@link ResolvableFieldOptions#getRuntime}
* @param runtime The functions runtime.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder runtime(software.amazon.awscdk.services.appsync.FunctionRuntime runtime) {
this.runtime = runtime;
return this;
}
/**
* Sets the value of {@link ResolvableFieldOptions#getReturnType}
* @param returnType The return type for this field. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder returnType(io.github.cdklabs.awscdk.appsync.utils.GraphqlType returnType) {
this.returnType = returnType;
return this;
}
/**
* Sets the value of {@link ResolvableFieldOptions#getArgs}
* @param args 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
*
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@SuppressWarnings("unchecked")
public Builder args(java.util.Map args) {
this.args = (java.util.Map)args;
return this;
}
/**
* Sets the value of {@link ResolvableFieldOptions#getDirectives}
* @param directives the directives for this field.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@SuppressWarnings("unchecked")
public Builder directives(java.util.List extends io.github.cdklabs.awscdk.appsync.utils.Directive> directives) {
this.directives = (java.util.List)directives;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link ResolvableFieldOptions}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public ResolvableFieldOptions build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link ResolvableFieldOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements ResolvableFieldOptions {
private final software.amazon.awscdk.services.appsync.CachingConfig cachingConfig;
private final software.amazon.awscdk.services.appsync.Code code;
private final software.amazon.awscdk.services.appsync.BaseDataSource dataSource;
private final java.lang.Number maxBatchSize;
private final java.util.List pipelineConfig;
private final software.amazon.awscdk.services.appsync.MappingTemplate requestMappingTemplate;
private final software.amazon.awscdk.services.appsync.MappingTemplate responseMappingTemplate;
private final software.amazon.awscdk.services.appsync.FunctionRuntime runtime;
private final io.github.cdklabs.awscdk.appsync.utils.GraphqlType returnType;
private final java.util.Map args;
private final java.util.List directives;
/**
* 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.cachingConfig = software.amazon.jsii.Kernel.get(this, "cachingConfig", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.appsync.CachingConfig.class));
this.code = software.amazon.jsii.Kernel.get(this, "code", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.appsync.Code.class));
this.dataSource = software.amazon.jsii.Kernel.get(this, "dataSource", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.appsync.BaseDataSource.class));
this.maxBatchSize = software.amazon.jsii.Kernel.get(this, "maxBatchSize", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.pipelineConfig = software.amazon.jsii.Kernel.get(this, "pipelineConfig", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.appsync.IAppsyncFunction.class)));
this.requestMappingTemplate = software.amazon.jsii.Kernel.get(this, "requestMappingTemplate", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.appsync.MappingTemplate.class));
this.responseMappingTemplate = software.amazon.jsii.Kernel.get(this, "responseMappingTemplate", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.appsync.MappingTemplate.class));
this.runtime = software.amazon.jsii.Kernel.get(this, "runtime", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.appsync.FunctionRuntime.class));
this.returnType = software.amazon.jsii.Kernel.get(this, "returnType", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.awscdk.appsync.utils.GraphqlType.class));
this.args = software.amazon.jsii.Kernel.get(this, "args", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(io.github.cdklabs.awscdk.appsync.utils.GraphqlType.class)));
this.directives = software.amazon.jsii.Kernel.get(this, "directives", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(io.github.cdklabs.awscdk.appsync.utils.Directive.class)));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
@SuppressWarnings("unchecked")
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.cachingConfig = builder.cachingConfig;
this.code = builder.code;
this.dataSource = builder.dataSource;
this.maxBatchSize = builder.maxBatchSize;
this.pipelineConfig = (java.util.List)builder.pipelineConfig;
this.requestMappingTemplate = builder.requestMappingTemplate;
this.responseMappingTemplate = builder.responseMappingTemplate;
this.runtime = builder.runtime;
this.returnType = java.util.Objects.requireNonNull(builder.returnType, "returnType is required");
this.args = (java.util.Map)builder.args;
this.directives = (java.util.List)builder.directives;
}
@Override
public final software.amazon.awscdk.services.appsync.CachingConfig getCachingConfig() {
return this.cachingConfig;
}
@Override
public final software.amazon.awscdk.services.appsync.Code getCode() {
return this.code;
}
@Override
public final software.amazon.awscdk.services.appsync.BaseDataSource getDataSource() {
return this.dataSource;
}
@Override
public final java.lang.Number getMaxBatchSize() {
return this.maxBatchSize;
}
@Override
public final java.util.List getPipelineConfig() {
return this.pipelineConfig;
}
@Override
public final software.amazon.awscdk.services.appsync.MappingTemplate getRequestMappingTemplate() {
return this.requestMappingTemplate;
}
@Override
public final software.amazon.awscdk.services.appsync.MappingTemplate getResponseMappingTemplate() {
return this.responseMappingTemplate;
}
@Override
public final software.amazon.awscdk.services.appsync.FunctionRuntime getRuntime() {
return this.runtime;
}
@Override
public final io.github.cdklabs.awscdk.appsync.utils.GraphqlType getReturnType() {
return this.returnType;
}
@Override
public final java.util.Map getArgs() {
return this.args;
}
@Override
public final java.util.List getDirectives() {
return this.directives;
}
@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.getCachingConfig() != null) {
data.set("cachingConfig", om.valueToTree(this.getCachingConfig()));
}
if (this.getCode() != null) {
data.set("code", om.valueToTree(this.getCode()));
}
if (this.getDataSource() != null) {
data.set("dataSource", om.valueToTree(this.getDataSource()));
}
if (this.getMaxBatchSize() != null) {
data.set("maxBatchSize", om.valueToTree(this.getMaxBatchSize()));
}
if (this.getPipelineConfig() != null) {
data.set("pipelineConfig", om.valueToTree(this.getPipelineConfig()));
}
if (this.getRequestMappingTemplate() != null) {
data.set("requestMappingTemplate", om.valueToTree(this.getRequestMappingTemplate()));
}
if (this.getResponseMappingTemplate() != null) {
data.set("responseMappingTemplate", om.valueToTree(this.getResponseMappingTemplate()));
}
if (this.getRuntime() != null) {
data.set("runtime", om.valueToTree(this.getRuntime()));
}
data.set("returnType", om.valueToTree(this.getReturnType()));
if (this.getArgs() != null) {
data.set("args", om.valueToTree(this.getArgs()));
}
if (this.getDirectives() != null) {
data.set("directives", om.valueToTree(this.getDirectives()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("awscdk-appsync-utils.ResolvableFieldOptions"));
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;
ResolvableFieldOptions.Jsii$Proxy that = (ResolvableFieldOptions.Jsii$Proxy) o;
if (this.cachingConfig != null ? !this.cachingConfig.equals(that.cachingConfig) : that.cachingConfig != null) return false;
if (this.code != null ? !this.code.equals(that.code) : that.code != null) return false;
if (this.dataSource != null ? !this.dataSource.equals(that.dataSource) : that.dataSource != null) return false;
if (this.maxBatchSize != null ? !this.maxBatchSize.equals(that.maxBatchSize) : that.maxBatchSize != null) return false;
if (this.pipelineConfig != null ? !this.pipelineConfig.equals(that.pipelineConfig) : that.pipelineConfig != null) return false;
if (this.requestMappingTemplate != null ? !this.requestMappingTemplate.equals(that.requestMappingTemplate) : that.requestMappingTemplate != null) return false;
if (this.responseMappingTemplate != null ? !this.responseMappingTemplate.equals(that.responseMappingTemplate) : that.responseMappingTemplate != null) return false;
if (this.runtime != null ? !this.runtime.equals(that.runtime) : that.runtime != null) return false;
if (!returnType.equals(that.returnType)) return false;
if (this.args != null ? !this.args.equals(that.args) : that.args != null) return false;
return this.directives != null ? this.directives.equals(that.directives) : that.directives == null;
}
@Override
public final int hashCode() {
int result = this.cachingConfig != null ? this.cachingConfig.hashCode() : 0;
result = 31 * result + (this.code != null ? this.code.hashCode() : 0);
result = 31 * result + (this.dataSource != null ? this.dataSource.hashCode() : 0);
result = 31 * result + (this.maxBatchSize != null ? this.maxBatchSize.hashCode() : 0);
result = 31 * result + (this.pipelineConfig != null ? this.pipelineConfig.hashCode() : 0);
result = 31 * result + (this.requestMappingTemplate != null ? this.requestMappingTemplate.hashCode() : 0);
result = 31 * result + (this.responseMappingTemplate != null ? this.responseMappingTemplate.hashCode() : 0);
result = 31 * result + (this.runtime != null ? this.runtime.hashCode() : 0);
result = 31 * result + (this.returnType.hashCode());
result = 31 * result + (this.args != null ? this.args.hashCode() : 0);
result = 31 * result + (this.directives != null ? this.directives.hashCode() : 0);
return result;
}
}
}