software.amazon.awscdk.services.lambda.CfnPermissionProps Maven / Gradle / Ivy
Show all versions of lambda Show documentation
package software.amazon.awscdk.services.lambda;
/**
* Properties for defining a `AWS::Lambda::Permission`.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.3.2 (build 237c474)", date = "2020-04-21T17:16:10.391Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.lambda.$Module.class, fqn = "@aws-cdk/aws-lambda.CfnPermissionProps")
@software.amazon.jsii.Jsii.Proxy(CfnPermissionProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.External)
public interface CfnPermissionProps extends software.amazon.jsii.JsiiSerializable {
/**
* `AWS::Lambda::Permission.Action`.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-action
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.External)
@org.jetbrains.annotations.NotNull java.lang.String getAction();
/**
* `AWS::Lambda::Permission.FunctionName`.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-functionname
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.External)
@org.jetbrains.annotations.NotNull java.lang.String getFunctionName();
/**
* `AWS::Lambda::Permission.Principal`.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-principal
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.External)
@org.jetbrains.annotations.NotNull java.lang.String getPrincipal();
/**
* `AWS::Lambda::Permission.EventSourceToken`.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-eventsourcetoken
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.External)
default @org.jetbrains.annotations.Nullable java.lang.String getEventSourceToken() {
return null;
}
/**
* `AWS::Lambda::Permission.SourceAccount`.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-sourceaccount
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.External)
default @org.jetbrains.annotations.Nullable java.lang.String getSourceAccount() {
return null;
}
/**
* `AWS::Lambda::Permission.SourceArn`.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-sourcearn
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.External)
default @org.jetbrains.annotations.Nullable java.lang.String getSourceArn() {
return null;
}
/**
* @return a {@link Builder} of {@link CfnPermissionProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.External)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link CfnPermissionProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.External)
public static final class Builder {
private java.lang.String action;
private java.lang.String functionName;
private java.lang.String principal;
private java.lang.String eventSourceToken;
private java.lang.String sourceAccount;
private java.lang.String sourceArn;
/**
* Sets the value of {@link CfnPermissionProps#getAction}
* @param action `AWS::Lambda::Permission.Action`. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.External)
public Builder action(java.lang.String action) {
this.action = action;
return this;
}
/**
* Sets the value of {@link CfnPermissionProps#getFunctionName}
* @param functionName `AWS::Lambda::Permission.FunctionName`. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.External)
public Builder functionName(java.lang.String functionName) {
this.functionName = functionName;
return this;
}
/**
* Sets the value of {@link CfnPermissionProps#getPrincipal}
* @param principal `AWS::Lambda::Permission.Principal`. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.External)
public Builder principal(java.lang.String principal) {
this.principal = principal;
return this;
}
/**
* Sets the value of {@link CfnPermissionProps#getEventSourceToken}
* @param eventSourceToken `AWS::Lambda::Permission.EventSourceToken`.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.External)
public Builder eventSourceToken(java.lang.String eventSourceToken) {
this.eventSourceToken = eventSourceToken;
return this;
}
/**
* Sets the value of {@link CfnPermissionProps#getSourceAccount}
* @param sourceAccount `AWS::Lambda::Permission.SourceAccount`.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.External)
public Builder sourceAccount(java.lang.String sourceAccount) {
this.sourceAccount = sourceAccount;
return this;
}
/**
* Sets the value of {@link CfnPermissionProps#getSourceArn}
* @param sourceArn `AWS::Lambda::Permission.SourceArn`.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.External)
public Builder sourceArn(java.lang.String sourceArn) {
this.sourceArn = sourceArn;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link CfnPermissionProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.External)
public CfnPermissionProps build() {
return new Jsii$Proxy(action, functionName, principal, eventSourceToken, sourceAccount, sourceArn);
}
}
/**
* An implementation for {@link CfnPermissionProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.External)
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements CfnPermissionProps {
private final java.lang.String action;
private final java.lang.String functionName;
private final java.lang.String principal;
private final java.lang.String eventSourceToken;
private final java.lang.String sourceAccount;
private final java.lang.String sourceArn;
/**
* 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.action = this.jsiiGet("action", java.lang.String.class);
this.functionName = this.jsiiGet("functionName", java.lang.String.class);
this.principal = this.jsiiGet("principal", java.lang.String.class);
this.eventSourceToken = this.jsiiGet("eventSourceToken", java.lang.String.class);
this.sourceAccount = this.jsiiGet("sourceAccount", java.lang.String.class);
this.sourceArn = this.jsiiGet("sourceArn", 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 action, final java.lang.String functionName, final java.lang.String principal, final java.lang.String eventSourceToken, final java.lang.String sourceAccount, final java.lang.String sourceArn) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.action = java.util.Objects.requireNonNull(action, "action is required");
this.functionName = java.util.Objects.requireNonNull(functionName, "functionName is required");
this.principal = java.util.Objects.requireNonNull(principal, "principal is required");
this.eventSourceToken = eventSourceToken;
this.sourceAccount = sourceAccount;
this.sourceArn = sourceArn;
}
@Override
public java.lang.String getAction() {
return this.action;
}
@Override
public java.lang.String getFunctionName() {
return this.functionName;
}
@Override
public java.lang.String getPrincipal() {
return this.principal;
}
@Override
public java.lang.String getEventSourceToken() {
return this.eventSourceToken;
}
@Override
public java.lang.String getSourceAccount() {
return this.sourceAccount;
}
@Override
public java.lang.String getSourceArn() {
return this.sourceArn;
}
@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("action", om.valueToTree(this.getAction()));
data.set("functionName", om.valueToTree(this.getFunctionName()));
data.set("principal", om.valueToTree(this.getPrincipal()));
if (this.getEventSourceToken() != null) {
data.set("eventSourceToken", om.valueToTree(this.getEventSourceToken()));
}
if (this.getSourceAccount() != null) {
data.set("sourceAccount", om.valueToTree(this.getSourceAccount()));
}
if (this.getSourceArn() != null) {
data.set("sourceArn", om.valueToTree(this.getSourceArn()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk/aws-lambda.CfnPermissionProps"));
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;
CfnPermissionProps.Jsii$Proxy that = (CfnPermissionProps.Jsii$Proxy) o;
if (!action.equals(that.action)) return false;
if (!functionName.equals(that.functionName)) return false;
if (!principal.equals(that.principal)) return false;
if (this.eventSourceToken != null ? !this.eventSourceToken.equals(that.eventSourceToken) : that.eventSourceToken != null) return false;
if (this.sourceAccount != null ? !this.sourceAccount.equals(that.sourceAccount) : that.sourceAccount != null) return false;
return this.sourceArn != null ? this.sourceArn.equals(that.sourceArn) : that.sourceArn == null;
}
@Override
public int hashCode() {
int result = this.action.hashCode();
result = 31 * result + (this.functionName.hashCode());
result = 31 * result + (this.principal.hashCode());
result = 31 * result + (this.eventSourceToken != null ? this.eventSourceToken.hashCode() : 0);
result = 31 * result + (this.sourceAccount != null ? this.sourceAccount.hashCode() : 0);
result = 31 * result + (this.sourceArn != null ? this.sourceArn.hashCode() : 0);
return result;
}
}
}