software.amazon.awscdk.services.oam.CfnSinkProps Maven / Gradle / Ivy
Show all versions of oam Show documentation
package software.amazon.awscdk.services.oam;
/**
* Properties for defining a `CfnSink`.
*
* Example:
*
*
* // The code below shows an example of how to instantiate this type.
* // The values are placeholders you should change.
* import software.amazon.awscdk.services.oam.*;
* Object policy;
* CfnSinkProps cfnSinkProps = CfnSinkProps.builder()
* .name("name")
* // the properties below are optional
* .policy(policy)
* .tags(Map.of(
* "tagsKey", "tags"))
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.74.0 (build 6d08790)", date = "2023-03-28T21:34:18.143Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.oam.$Module.class, fqn = "@aws-cdk/aws-oam.CfnSinkProps")
@software.amazon.jsii.Jsii.Proxy(CfnSinkProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface CfnSinkProps extends software.amazon.jsii.JsiiSerializable {
/**
* A name for the sink.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.lang.String getName();
/**
* The IAM policy that grants permissions to source accounts to link to this sink.
*
* The policy can grant permission in the following ways:
*
*
* - Include organization IDs or organization paths to permit all accounts in an organization
* - Include account IDs to permit the specified accounts
*
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Object getPolicy() {
return null;
}
/**
* An array of key-value pairs to apply to the sink.
*
* For more information, see Tag .
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.Map getTags() {
return null;
}
/**
* @return a {@link Builder} of {@link CfnSinkProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link CfnSinkProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String name;
java.lang.Object policy;
java.util.Map tags;
/**
* Sets the value of {@link CfnSinkProps#getName}
* @param name A name for the sink. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder name(java.lang.String name) {
this.name = name;
return this;
}
/**
* Sets the value of {@link CfnSinkProps#getPolicy}
* @param policy The IAM policy that grants permissions to source accounts to link to this sink.
* The policy can grant permission in the following ways:
*
*
* - Include organization IDs or organization paths to permit all accounts in an organization
* - Include account IDs to permit the specified accounts
*
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder policy(java.lang.Object policy) {
this.policy = policy;
return this;
}
/**
* Sets the value of {@link CfnSinkProps#getTags}
* @param tags An array of key-value pairs to apply to the sink.
* For more information, see Tag .
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder tags(java.util.Map tags) {
this.tags = tags;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link CfnSinkProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public CfnSinkProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link CfnSinkProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements CfnSinkProps {
private final java.lang.String name;
private final java.lang.Object policy;
private final java.util.Map tags;
/**
* 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.name = software.amazon.jsii.Kernel.get(this, "name", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.policy = software.amazon.jsii.Kernel.get(this, "policy", software.amazon.jsii.NativeType.forClass(java.lang.Object.class));
this.tags = software.amazon.jsii.Kernel.get(this, "tags", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.String.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.name = java.util.Objects.requireNonNull(builder.name, "name is required");
this.policy = builder.policy;
this.tags = builder.tags;
}
@Override
public final java.lang.String getName() {
return this.name;
}
@Override
public final java.lang.Object getPolicy() {
return this.policy;
}
@Override
public final java.util.Map getTags() {
return this.tags;
}
@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("name", om.valueToTree(this.getName()));
if (this.getPolicy() != null) {
data.set("policy", om.valueToTree(this.getPolicy()));
}
if (this.getTags() != null) {
data.set("tags", om.valueToTree(this.getTags()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk/aws-oam.CfnSinkProps"));
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;
CfnSinkProps.Jsii$Proxy that = (CfnSinkProps.Jsii$Proxy) o;
if (!name.equals(that.name)) return false;
if (this.policy != null ? !this.policy.equals(that.policy) : that.policy != null) return false;
return this.tags != null ? this.tags.equals(that.tags) : that.tags == null;
}
@Override
public final int hashCode() {
int result = this.name.hashCode();
result = 31 * result + (this.policy != null ? this.policy.hashCode() : 0);
result = 31 * result + (this.tags != null ? this.tags.hashCode() : 0);
return result;
}
}
}