All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awscdk.services.codepipeline.actions.LambdaInvokeActionProps Maven / Gradle / Ivy

package software.amazon.awscdk.services.codepipeline.actions;

/**
 * Construction properties of the {@link LambdaInvokeAction Lambda invoke CodePipeline Action}.
 */
@javax.annotation.Generated(value = "jsii-pacmak/0.10.3 (build 6bbf743)", date = "2019-05-02T10:15:47.478Z")
public interface LambdaInvokeActionProps extends software.amazon.jsii.JsiiSerializable, software.amazon.awscdk.services.codepipeline.CommonActionProps {
    /**
     * The lambda function to invoke.
     */
    software.amazon.awscdk.services.lambda.IFunction getLambda();
    /**
     * Adds the "codepipeline:PutJobSuccessResult" and "codepipeline:PutJobFailureResult" for '*' resource to the Lambda execution role policy.
     * 
     * NOTE: the reason we can't add the specific pipeline ARN as a resource is
     * to avoid a cyclic dependency between the pipeline and the Lambda function
     * (the pipeline references) the Lambda and the Lambda needs permissions on
     * the pipeline.
     * 
     * Default: true
     * 
     * @see https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html#actions-invoke-lambda-function-create-function
     */
    java.lang.Boolean getAddPutJobResultPolicy();
    /**
     * The optional input Artifacts of the Action. A Lambda Action can have up to 5 inputs. The inputs will appear in the event passed to the Lambda, under the `'CodePipeline.job'.data.inputArtifacts` path.
     * 
     * Default: the Action will not have any inputs
     * 
     * @see https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html#actions-invoke-lambda-function-json-event-example
     */
    java.util.List getInputs();
    /**
     * The optional names of the output Artifacts of the Action. A Lambda Action can have up to 5 outputs. The outputs will appear in the event passed to the Lambda, under the `'CodePipeline.job'.data.outputArtifacts` path. It is the responsibility of the Lambda to upload ZIP files with the Artifact contents to the provided locations.
     * 
     * Default: the Action will not have any outputs
     */
    java.util.List getOutputs();
    /**
     * String to be used in the event data parameter passed to the Lambda function.
     * 
     * See an example JSON event in the CodePipeline documentation.
     * 
     * https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html#actions-invoke-lambda-function-json-event-example
     */
    java.lang.Object getUserParameters();

    /**
     * @return a {@link Builder} of {@link LambdaInvokeActionProps}
     */
    static Builder builder() {
        return new Builder();
    }

    /**
     * A builder for {@link LambdaInvokeActionProps}
     */
    final class Builder {
        private software.amazon.awscdk.services.lambda.IFunction _lambda;
        @javax.annotation.Nullable
        private java.lang.Boolean _addPutJobResultPolicy;
        @javax.annotation.Nullable
        private java.util.List _inputs;
        @javax.annotation.Nullable
        private java.util.List _outputs;
        @javax.annotation.Nullable
        private java.lang.Object _userParameters;
        private java.lang.String _actionName;
        @javax.annotation.Nullable
        private java.lang.Number _runOrder;

        /**
         * Sets the value of Lambda
         * @param value The lambda function to invoke.
         * @return {@code this}
         */
        public Builder withLambda(final software.amazon.awscdk.services.lambda.IFunction value) {
            this._lambda = java.util.Objects.requireNonNull(value, "lambda is required");
            return this;
        }
        /**
         * Sets the value of AddPutJobResultPolicy
         * @param value Adds the "codepipeline:PutJobSuccessResult" and "codepipeline:PutJobFailureResult" for '*' resource to the Lambda execution role policy.
         * @return {@code this}
         */
        public Builder withAddPutJobResultPolicy(@javax.annotation.Nullable final java.lang.Boolean value) {
            this._addPutJobResultPolicy = value;
            return this;
        }
        /**
         * Sets the value of Inputs
         * @param value The optional input Artifacts of the Action. A Lambda Action can have up to 5 inputs. The inputs will appear in the event passed to the Lambda, under the `'CodePipeline.job'.data.inputArtifacts` path.
         * @return {@code this}
         */
        public Builder withInputs(@javax.annotation.Nullable final java.util.List value) {
            this._inputs = value;
            return this;
        }
        /**
         * Sets the value of Outputs
         * @param value The optional names of the output Artifacts of the Action. A Lambda Action can have up to 5 outputs. The outputs will appear in the event passed to the Lambda, under the `'CodePipeline.job'.data.outputArtifacts` path. It is the responsibility of the Lambda to upload ZIP files with the Artifact contents to the provided locations.
         * @return {@code this}
         */
        public Builder withOutputs(@javax.annotation.Nullable final java.util.List value) {
            this._outputs = value;
            return this;
        }
        /**
         * Sets the value of UserParameters
         * @param value String to be used in the event data parameter passed to the Lambda function.
         * @return {@code this}
         */
        public Builder withUserParameters(@javax.annotation.Nullable final java.lang.Object value) {
            this._userParameters = value;
            return this;
        }
        /**
         * Sets the value of ActionName
         * @param value The physical, human-readable name of the Action. Not that Action names must be unique within a single Stage.
         * @return {@code this}
         */
        public Builder withActionName(final java.lang.String value) {
            this._actionName = java.util.Objects.requireNonNull(value, "actionName is required");
            return this;
        }
        /**
         * Sets the value of RunOrder
         * @param value The runOrder property for this Action. RunOrder determines the relative order in which multiple Actions in the same Stage execute.
         * @return {@code this}
         */
        public Builder withRunOrder(@javax.annotation.Nullable final java.lang.Number value) {
            this._runOrder = value;
            return this;
        }

        /**
         * Builds the configured instance.
         * @return a new instance of {@link LambdaInvokeActionProps}
         * @throws NullPointerException if any required attribute was not provided
         */
        public LambdaInvokeActionProps build() {
            return new LambdaInvokeActionProps() {
                private final software.amazon.awscdk.services.lambda.IFunction $lambda = java.util.Objects.requireNonNull(_lambda, "lambda is required");
                @javax.annotation.Nullable
                private final java.lang.Boolean $addPutJobResultPolicy = _addPutJobResultPolicy;
                @javax.annotation.Nullable
                private final java.util.List $inputs = _inputs;
                @javax.annotation.Nullable
                private final java.util.List $outputs = _outputs;
                @javax.annotation.Nullable
                private final java.lang.Object $userParameters = _userParameters;
                private final java.lang.String $actionName = java.util.Objects.requireNonNull(_actionName, "actionName is required");
                @javax.annotation.Nullable
                private final java.lang.Number $runOrder = _runOrder;

                @Override
                public software.amazon.awscdk.services.lambda.IFunction getLambda() {
                    return this.$lambda;
                }

                @Override
                public java.lang.Boolean getAddPutJobResultPolicy() {
                    return this.$addPutJobResultPolicy;
                }

                @Override
                public java.util.List getInputs() {
                    return this.$inputs;
                }

                @Override
                public java.util.List getOutputs() {
                    return this.$outputs;
                }

                @Override
                public java.lang.Object getUserParameters() {
                    return this.$userParameters;
                }

                @Override
                public java.lang.String getActionName() {
                    return this.$actionName;
                }

                @Override
                public java.lang.Number getRunOrder() {
                    return this.$runOrder;
                }

                public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
                    com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
                    com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
                    obj.set("lambda", om.valueToTree(this.getLambda()));
                    obj.set("addPutJobResultPolicy", om.valueToTree(this.getAddPutJobResultPolicy()));
                    obj.set("inputs", om.valueToTree(this.getInputs()));
                    obj.set("outputs", om.valueToTree(this.getOutputs()));
                    obj.set("userParameters", om.valueToTree(this.getUserParameters()));
                    obj.set("actionName", om.valueToTree(this.getActionName()));
                    obj.set("runOrder", om.valueToTree(this.getRunOrder()));
                    return obj;
                }

            };
        }
    }

    /**
     * A proxy class which represents a concrete javascript instance of this type.
     */
    final static class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements software.amazon.awscdk.services.codepipeline.actions.LambdaInvokeActionProps {
        protected Jsii$Proxy(final software.amazon.jsii.JsiiObject.InitializationMode mode) {
            super(mode);
        }

        /**
         * The lambda function to invoke.
         */
        @Override
        public software.amazon.awscdk.services.lambda.IFunction getLambda() {
            return this.jsiiGet("lambda", software.amazon.awscdk.services.lambda.IFunction.class);
        }

        /**
         * Adds the "codepipeline:PutJobSuccessResult" and "codepipeline:PutJobFailureResult" for '*' resource to the Lambda execution role policy.
         * 
         * NOTE: the reason we can't add the specific pipeline ARN as a resource is
         * to avoid a cyclic dependency between the pipeline and the Lambda function
         * (the pipeline references) the Lambda and the Lambda needs permissions on
         * the pipeline.
         * 
         * Default: true
         * 
         * @see https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html#actions-invoke-lambda-function-create-function
         */
        @Override
        @javax.annotation.Nullable
        public java.lang.Boolean getAddPutJobResultPolicy() {
            return this.jsiiGet("addPutJobResultPolicy", java.lang.Boolean.class);
        }

        /**
         * The optional input Artifacts of the Action. A Lambda Action can have up to 5 inputs. The inputs will appear in the event passed to the Lambda, under the `'CodePipeline.job'.data.inputArtifacts` path.
         * 
         * Default: the Action will not have any inputs
         * 
         * @see https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html#actions-invoke-lambda-function-json-event-example
         */
        @Override
        @javax.annotation.Nullable
        public java.util.List getInputs() {
            return this.jsiiGet("inputs", java.util.List.class);
        }

        /**
         * The optional names of the output Artifacts of the Action. A Lambda Action can have up to 5 outputs. The outputs will appear in the event passed to the Lambda, under the `'CodePipeline.job'.data.outputArtifacts` path. It is the responsibility of the Lambda to upload ZIP files with the Artifact contents to the provided locations.
         * 
         * Default: the Action will not have any outputs
         */
        @Override
        @javax.annotation.Nullable
        public java.util.List getOutputs() {
            return this.jsiiGet("outputs", java.util.List.class);
        }

        /**
         * String to be used in the event data parameter passed to the Lambda function.
         * 
         * See an example JSON event in the CodePipeline documentation.
         * 
         * https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html#actions-invoke-lambda-function-json-event-example
         */
        @Override
        @javax.annotation.Nullable
        public java.lang.Object getUserParameters() {
            return this.jsiiGet("userParameters", java.lang.Object.class);
        }

        /**
         * The physical, human-readable name of the Action. Not that Action names must be unique within a single Stage.
         */
        @Override
        public java.lang.String getActionName() {
            return this.jsiiGet("actionName", java.lang.String.class);
        }

        /**
         * The runOrder property for this Action. RunOrder determines the relative order in which multiple Actions in the same Stage execute.
         * 
         * Default: 1
         * 
         * @see https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html
         */
        @Override
        @javax.annotation.Nullable
        public java.lang.Number getRunOrder() {
            return this.jsiiGet("runOrder", java.lang.Number.class);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy