software.amazon.awscdk.integtests.alpha.AwsApiCallProps Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cdk-integ-tests-alpha Show documentation
Show all versions of cdk-integ-tests-alpha Show documentation
CDK Integration Testing Constructs
package software.amazon.awscdk.integtests.alpha;
/**
* (experimental) Construct that creates a custom resource that will perform a query using the AWS SDK.
*
* Example:
*
*
* Stack myAppStack;
* AwsApiCall.Builder.create(myAppStack, "GetObject")
* .service("S3")
* .api("getObject")
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-19T18:12:09.659Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.integtests.alpha.$Module.class, fqn = "@aws-cdk/integ-tests-alpha.AwsApiCallProps")
@software.amazon.jsii.Jsii.Proxy(AwsApiCallProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface AwsApiCallProps extends software.amazon.jsii.JsiiSerializable, software.amazon.awscdk.integtests.alpha.AwsApiCallOptions {
/**
* @return a {@link Builder} of {@link AwsApiCallProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link AwsApiCallProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String api;
java.lang.String service;
java.util.List outputPaths;
java.lang.Object parameters;
/**
* Sets the value of {@link AwsApiCallProps#getApi}
* @param api The api call to make, i.e. getBucketLifecycle. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder api(java.lang.String api) {
this.api = api;
return this;
}
/**
* Sets the value of {@link AwsApiCallProps#getService}
* @param service The AWS service, i.e. S3. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder service(java.lang.String service) {
this.service = service;
return this;
}
/**
* Sets the value of {@link AwsApiCallProps#getOutputPaths}
* @param outputPaths Restrict the data returned by the API call to specific paths in the API response.
* Use this to limit the data returned by the custom
* resource if working with API calls that could potentially result in custom
* response objects exceeding the hard limit of 4096 bytes.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder outputPaths(java.util.List outputPaths) {
this.outputPaths = outputPaths;
return this;
}
/**
* Sets the value of {@link AwsApiCallProps#getParameters}
* @param parameters Any parameters to pass to the api call.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder parameters(java.lang.Object parameters) {
this.parameters = parameters;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link AwsApiCallProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public AwsApiCallProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link AwsApiCallProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements AwsApiCallProps {
private final java.lang.String api;
private final java.lang.String service;
private final java.util.List outputPaths;
private final java.lang.Object parameters;
/**
* 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.api = software.amazon.jsii.Kernel.get(this, "api", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.service = software.amazon.jsii.Kernel.get(this, "service", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.outputPaths = software.amazon.jsii.Kernel.get(this, "outputPaths", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.parameters = software.amazon.jsii.Kernel.get(this, "parameters", software.amazon.jsii.NativeType.forClass(java.lang.Object.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.api = java.util.Objects.requireNonNull(builder.api, "api is required");
this.service = java.util.Objects.requireNonNull(builder.service, "service is required");
this.outputPaths = builder.outputPaths;
this.parameters = builder.parameters;
}
@Override
public final java.lang.String getApi() {
return this.api;
}
@Override
public final java.lang.String getService() {
return this.service;
}
@Override
public final java.util.List getOutputPaths() {
return this.outputPaths;
}
@Override
public final java.lang.Object getParameters() {
return this.parameters;
}
@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();
data.set("api", om.valueToTree(this.getApi()));
data.set("service", om.valueToTree(this.getService()));
if (this.getOutputPaths() != null) {
data.set("outputPaths", om.valueToTree(this.getOutputPaths()));
}
if (this.getParameters() != null) {
data.set("parameters", om.valueToTree(this.getParameters()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk/integ-tests-alpha.AwsApiCallProps"));
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;
AwsApiCallProps.Jsii$Proxy that = (AwsApiCallProps.Jsii$Proxy) o;
if (!api.equals(that.api)) return false;
if (!service.equals(that.service)) return false;
if (this.outputPaths != null ? !this.outputPaths.equals(that.outputPaths) : that.outputPaths != null) return false;
return this.parameters != null ? this.parameters.equals(that.parameters) : that.parameters == null;
}
@Override
public final int hashCode() {
int result = this.api.hashCode();
result = 31 * result + (this.service.hashCode());
result = 31 * result + (this.outputPaths != null ? this.outputPaths.hashCode() : 0);
result = 31 * result + (this.parameters != null ? this.parameters.hashCode() : 0);
return result;
}
}
}