software.amazon.awscdk.integtests.alpha.AwsApiCall Maven / Gradle / Ivy
Show all versions of cdk-integ-tests-alpha Show documentation
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-18T22:17:05.820Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.integtests.alpha.$Module.class, fqn = "@aws-cdk/integ-tests-alpha.AwsApiCall")
public class AwsApiCall extends software.amazon.awscdk.integtests.alpha.ApiCallBase {
protected AwsApiCall(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected AwsApiCall(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param scope This parameter is required.
* @param id This parameter is required.
* @param props This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public AwsApiCall(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.integtests.alpha.AwsApiCallProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(props, "props is required") });
}
/**
* (experimental) Assert that the ExpectedResult is equal to the result of the AwsApiCall at the given path.
*
* Providing a path will filter the output of the initial API call.
*
* For example the SQS.receiveMessage api response would look
* like:
*
* If you wanted to assert the value of Body
you could do
*
* @param path This parameter is required.
* @param expected This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.integtests.alpha.IApiCall assertAtPath(final @org.jetbrains.annotations.NotNull java.lang.String path, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.integtests.alpha.ExpectedResult expected) {
return software.amazon.jsii.Kernel.call(this, "assertAtPath", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.integtests.alpha.IApiCall.class), new Object[] { java.util.Objects.requireNonNull(path, "path is required"), java.util.Objects.requireNonNull(expected, "expected is required") });
}
/**
* (experimental) Wait for the IApiCall to return the expected response.
*
* If no expected response is specified then it will wait for
* the IApiCall to return a success
*
* @param options
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.integtests.alpha.IApiCall waitForAssertions(final @org.jetbrains.annotations.Nullable software.amazon.awscdk.integtests.alpha.WaiterStateMachineOptions options) {
return software.amazon.jsii.Kernel.call(this, "waitForAssertions", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.integtests.alpha.IApiCall.class), new Object[] { options });
}
/**
* (experimental) Wait for the IApiCall to return the expected response.
*
* If no expected response is specified then it will wait for
* the IApiCall to return a success
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.integtests.alpha.IApiCall waitForAssertions() {
return software.amazon.jsii.Kernel.call(this, "waitForAssertions", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.integtests.alpha.IApiCall.class));
}
/**
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
protected @org.jetbrains.annotations.NotNull software.amazon.awscdk.CustomResource getApiCallResource() {
return software.amazon.jsii.Kernel.get(this, "apiCallResource", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.CustomResource.class));
}
/**
* (experimental) access the AssertionsProvider.
*
* This can be used to add additional IAM policies
* the the provider role policy
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.integtests.alpha.AssertionsProvider getProvider() {
return software.amazon.jsii.Kernel.get(this, "provider", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.integtests.alpha.AssertionsProvider.class));
}
/**
* (experimental) access the AssertionsProvider for the waiter state machine.
*
* This can be used to add additional IAM policies
* the the provider role policy
*
* Example:
*
*
* AwsApiCall apiCall;
* apiCall.waiterProvider.addToRolePolicy(Map.of(
* "Effect", "Allow",
* "Action", List.of("s3:GetObject"),
* "Resource", List.of("*")));
*
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.Nullable software.amazon.awscdk.integtests.alpha.AssertionsProvider getWaiterProvider() {
return software.amazon.jsii.Kernel.get(this, "waiterProvider", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.integtests.alpha.AssertionsProvider.class));
}
/**
* (experimental) access the AssertionsProvider for the waiter state machine.
*
* This can be used to add additional IAM policies
* the the provider role policy
*
* Example:
*
*
* AwsApiCall apiCall;
* apiCall.waiterProvider.addToRolePolicy(Map.of(
* "Effect", "Allow",
* "Action", List.of("s3:GetObject"),
* "Resource", List.of("*")));
*
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void setWaiterProvider(final @org.jetbrains.annotations.Nullable software.amazon.awscdk.integtests.alpha.AssertionsProvider value) {
software.amazon.jsii.Kernel.set(this, "waiterProvider", value);
}
/**
* (experimental) A fluent builder for {@link software.amazon.awscdk.integtests.alpha.AwsApiCall}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param scope This parameter is required.
* @param id This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create(final software.constructs.Construct scope, final java.lang.String id) {
return new Builder(scope, id);
}
private final software.constructs.Construct scope;
private final java.lang.String id;
private final software.amazon.awscdk.integtests.alpha.AwsApiCallProps.Builder props;
private Builder(final software.constructs.Construct scope, final java.lang.String id) {
this.scope = scope;
this.id = id;
this.props = new software.amazon.awscdk.integtests.alpha.AwsApiCallProps.Builder();
}
/**
* (experimental) The api call to make, i.e. getBucketLifecycle.
*
* @return {@code this}
* @param api The api call to make, i.e. getBucketLifecycle. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder api(final java.lang.String api) {
this.props.api(api);
return this;
}
/**
* (experimental) The AWS service, i.e. S3.
*
* @return {@code this}
* @param service The AWS service, i.e. S3. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder service(final java.lang.String service) {
this.props.service(service);
return this;
}
/**
* (experimental) 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.
*
* Default: - return all data
*
* @return {@code this}
* @param outputPaths Restrict the data returned by the API call to specific paths in the API response. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder outputPaths(final java.util.List outputPaths) {
this.props.outputPaths(outputPaths);
return this;
}
/**
* (experimental) Any parameters to pass to the api call.
*
* Default: - no parameters
*
* @return {@code this}
* @param parameters Any parameters to pass to the api call. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder parameters(final java.lang.Object parameters) {
this.props.parameters(parameters);
return this;
}
/**
* @return a newly built instance of {@link software.amazon.awscdk.integtests.alpha.AwsApiCall}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public software.amazon.awscdk.integtests.alpha.AwsApiCall build() {
return new software.amazon.awscdk.integtests.alpha.AwsApiCall(
this.scope,
this.id,
this.props.build()
);
}
}
}