software.amazon.awscdk.services.appsync.GraphqlApiAttributes Maven / Gradle / Ivy
Show all versions of appsync Show documentation
package software.amazon.awscdk.services.appsync;
/**
* (experimental) Attributes for GraphQL imports.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.13.0 (build 385c325)", date = "2020-10-19T20:38:34.387Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.appsync.$Module.class, fqn = "@aws-cdk/aws-appsync.GraphqlApiAttributes")
@software.amazon.jsii.Jsii.Proxy(GraphqlApiAttributes.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface GraphqlApiAttributes extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) an unique AWS AppSync GraphQL API identifier i.e. 'lxz775lwdrgcndgz3nurvac7oa'.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.lang.String getGraphqlApiId();
/**
* (experimental) the arn for the GraphQL Api.
*
* Default: - autogenerated arn
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getGraphqlApiArn() {
return null;
}
/**
* @return a {@link Builder} of {@link GraphqlApiAttributes}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link GraphqlApiAttributes}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
private java.lang.String graphqlApiId;
private java.lang.String graphqlApiArn;
/**
* Sets the value of {@link GraphqlApiAttributes#getGraphqlApiId}
* @param graphqlApiId an unique AWS AppSync GraphQL API identifier i.e. 'lxz775lwdrgcndgz3nurvac7oa'. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder graphqlApiId(java.lang.String graphqlApiId) {
this.graphqlApiId = graphqlApiId;
return this;
}
/**
* Sets the value of {@link GraphqlApiAttributes#getGraphqlApiArn}
* @param graphqlApiArn the arn for the GraphQL Api.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder graphqlApiArn(java.lang.String graphqlApiArn) {
this.graphqlApiArn = graphqlApiArn;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link GraphqlApiAttributes}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public GraphqlApiAttributes build() {
return new Jsii$Proxy(graphqlApiId, graphqlApiArn);
}
}
/**
* An implementation for {@link GraphqlApiAttributes}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements GraphqlApiAttributes {
private final java.lang.String graphqlApiId;
private final java.lang.String graphqlApiArn;
/**
* 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.graphqlApiId = this.jsiiGet("graphqlApiId", java.lang.String.class);
this.graphqlApiArn = this.jsiiGet("graphqlApiArn", java.lang.String.class);
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
private Jsii$Proxy(final java.lang.String graphqlApiId, final java.lang.String graphqlApiArn) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.graphqlApiId = java.util.Objects.requireNonNull(graphqlApiId, "graphqlApiId is required");
this.graphqlApiArn = graphqlApiArn;
}
@Override
public java.lang.String getGraphqlApiId() {
return this.graphqlApiId;
}
@Override
public java.lang.String getGraphqlApiArn() {
return this.graphqlApiArn;
}
@Override
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();
data.set("graphqlApiId", om.valueToTree(this.getGraphqlApiId()));
if (this.getGraphqlApiArn() != null) {
data.set("graphqlApiArn", om.valueToTree(this.getGraphqlApiArn()));
}
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.GraphqlApiAttributes"));
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 boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
GraphqlApiAttributes.Jsii$Proxy that = (GraphqlApiAttributes.Jsii$Proxy) o;
if (!graphqlApiId.equals(that.graphqlApiId)) return false;
return this.graphqlApiArn != null ? this.graphqlApiArn.equals(that.graphqlApiArn) : that.graphqlApiArn == null;
}
@Override
public int hashCode() {
int result = this.graphqlApiId.hashCode();
result = 31 * result + (this.graphqlApiArn != null ? this.graphqlApiArn.hashCode() : 0);
return result;
}
}
}