software.amazon.awscdk.services.iot.actions.alpha.HttpsActionProps Maven / Gradle / Ivy
Show all versions of iot-actions-alpha Show documentation
package software.amazon.awscdk.services.iot.actions.alpha;
/**
* (experimental) Configuration properties of an HTTPS action.
*
* Example:
*
*
* TopicRule topicRule = TopicRule.Builder.create(this, "TopicRule")
* .sql(IotSql.fromStringAsVer20160323("SELECT topic(2) as device_id, year, month, day FROM 'device/+/data'"))
* .build();
* topicRule.addAction(
* HttpsAction.Builder.create("https://example.com/endpoint")
* .confirmationUrl("https://example.com")
* .headers(List.of(HttpActionHeader.builder().key("key0").value("value0").build(), HttpActionHeader.builder().key("key1").value("value1").build()))
* .auth(HttpActionSigV4Auth.builder().serviceName("serviceName").signingRegion("us-east-1").build())
* .build());
*
*
* @see https://docs.aws.amazon.com/iot/latest/developerguide/https-rule-action.html
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.102.0 (build e354887)", date = "2024-09-06T01:36:38.337Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.iot.actions.alpha.$Module.class, fqn = "@aws-cdk/aws-iot-actions-alpha.HttpsActionProps")
@software.amazon.jsii.Jsii.Proxy(HttpsActionProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface HttpsActionProps extends software.amazon.jsii.JsiiSerializable, software.amazon.awscdk.services.iot.actions.alpha.CommonActionProps {
/**
* (experimental) Use Sigv4 authorization.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.iot.actions.alpha.HttpActionSigV4Auth getAuth() {
return null;
}
/**
* (experimental) If specified, AWS IoT uses the confirmation URL to create a matching topic rule destination.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getConfirmationUrl() {
return null;
}
/**
* (experimental) The headers to include in the HTTPS request to the endpoint.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.List getHeaders() {
return null;
}
/**
* @return a {@link Builder} of {@link HttpsActionProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link HttpsActionProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
software.amazon.awscdk.services.iot.actions.alpha.HttpActionSigV4Auth auth;
java.lang.String confirmationUrl;
java.util.List headers;
software.amazon.awscdk.services.iam.IRole role;
/**
* Sets the value of {@link HttpsActionProps#getAuth}
* @param auth Use Sigv4 authorization.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder auth(software.amazon.awscdk.services.iot.actions.alpha.HttpActionSigV4Auth auth) {
this.auth = auth;
return this;
}
/**
* Sets the value of {@link HttpsActionProps#getConfirmationUrl}
* @param confirmationUrl If specified, AWS IoT uses the confirmation URL to create a matching topic rule destination.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder confirmationUrl(java.lang.String confirmationUrl) {
this.confirmationUrl = confirmationUrl;
return this;
}
/**
* Sets the value of {@link HttpsActionProps#getHeaders}
* @param headers The headers to include in the HTTPS request to the endpoint.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder headers(java.util.List extends software.amazon.awscdk.services.iot.actions.alpha.HttpActionHeader> headers) {
this.headers = (java.util.List)headers;
return this;
}
/**
* Sets the value of {@link HttpsActionProps#getRole}
* @param role The IAM role that allows access to AWS service.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder role(software.amazon.awscdk.services.iam.IRole role) {
this.role = role;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link HttpsActionProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public HttpsActionProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link HttpsActionProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements HttpsActionProps {
private final software.amazon.awscdk.services.iot.actions.alpha.HttpActionSigV4Auth auth;
private final java.lang.String confirmationUrl;
private final java.util.List headers;
private final software.amazon.awscdk.services.iam.IRole role;
/**
* 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.auth = software.amazon.jsii.Kernel.get(this, "auth", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.iot.actions.alpha.HttpActionSigV4Auth.class));
this.confirmationUrl = software.amazon.jsii.Kernel.get(this, "confirmationUrl", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.headers = software.amazon.jsii.Kernel.get(this, "headers", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.iot.actions.alpha.HttpActionHeader.class)));
this.role = software.amazon.jsii.Kernel.get(this, "role", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.iam.IRole.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.auth = builder.auth;
this.confirmationUrl = builder.confirmationUrl;
this.headers = (java.util.List)builder.headers;
this.role = builder.role;
}
@Override
public final software.amazon.awscdk.services.iot.actions.alpha.HttpActionSigV4Auth getAuth() {
return this.auth;
}
@Override
public final java.lang.String getConfirmationUrl() {
return this.confirmationUrl;
}
@Override
public final java.util.List getHeaders() {
return this.headers;
}
@Override
public final software.amazon.awscdk.services.iam.IRole getRole() {
return this.role;
}
@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.getAuth() != null) {
data.set("auth", om.valueToTree(this.getAuth()));
}
if (this.getConfirmationUrl() != null) {
data.set("confirmationUrl", om.valueToTree(this.getConfirmationUrl()));
}
if (this.getHeaders() != null) {
data.set("headers", om.valueToTree(this.getHeaders()));
}
if (this.getRole() != null) {
data.set("role", om.valueToTree(this.getRole()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk/aws-iot-actions-alpha.HttpsActionProps"));
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;
HttpsActionProps.Jsii$Proxy that = (HttpsActionProps.Jsii$Proxy) o;
if (this.auth != null ? !this.auth.equals(that.auth) : that.auth != null) return false;
if (this.confirmationUrl != null ? !this.confirmationUrl.equals(that.confirmationUrl) : that.confirmationUrl != null) return false;
if (this.headers != null ? !this.headers.equals(that.headers) : that.headers != null) return false;
return this.role != null ? this.role.equals(that.role) : that.role == null;
}
@Override
public final int hashCode() {
int result = this.auth != null ? this.auth.hashCode() : 0;
result = 31 * result + (this.confirmationUrl != null ? this.confirmationUrl.hashCode() : 0);
result = 31 * result + (this.headers != null ? this.headers.hashCode() : 0);
result = 31 * result + (this.role != null ? this.role.hashCode() : 0);
return result;
}
}
}