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

software.amazon.awsconstructs.services.apigatewaykinesisstreams.ApiGatewayToKinesisStreams Maven / Gradle / Ivy

There is a newer version: 2.76.0
Show newest version
package software.amazon.awsconstructs.services.apigatewaykinesisstreams;

/**
 */
@javax.annotation.Generated(value = "jsii-pacmak/1.63.2 (build a8a8833)", date = "2022-08-09T03:15:59.184Z")
@software.amazon.jsii.Jsii(module = software.amazon.awsconstructs.services.apigatewaykinesisstreams.$Module.class, fqn = "@aws-solutions-constructs/aws-apigateway-kinesisstreams.ApiGatewayToKinesisStreams")
public class ApiGatewayToKinesisStreams extends software.amazon.awscdk.core.Construct {

    protected ApiGatewayToKinesisStreams(final software.amazon.jsii.JsiiObjectRef objRef) {
        super(objRef);
    }

    protected ApiGatewayToKinesisStreams(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
        super(initializationMode);
    }

    /**
     * @param scope - represents the scope for all the resources. This parameter is required.
     * @param id - this is a a scope-unique id. This parameter is required.
     * @param props - user provided props for the construct. This parameter is required.
     */
    public ApiGatewayToKinesisStreams(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.core.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull software.amazon.awsconstructs.services.apigatewaykinesisstreams.ApiGatewayToKinesisStreamsProps 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") });
    }

    public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.apigateway.RestApi getApiGateway() {
        return software.amazon.jsii.Kernel.get(this, "apiGateway", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.apigateway.RestApi.class));
    }

    public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.logs.LogGroup getApiGatewayLogGroup() {
        return software.amazon.jsii.Kernel.get(this, "apiGatewayLogGroup", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.logs.LogGroup.class));
    }

    public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.iam.Role getApiGatewayRole() {
        return software.amazon.jsii.Kernel.get(this, "apiGatewayRole", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.iam.Role.class));
    }

    public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.kinesis.Stream getKinesisStream() {
        return software.amazon.jsii.Kernel.get(this, "kinesisStream", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.kinesis.Stream.class));
    }

    public @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.iam.Role getApiGatewayCloudWatchRole() {
        return software.amazon.jsii.Kernel.get(this, "apiGatewayCloudWatchRole", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.iam.Role.class));
    }

    public @org.jetbrains.annotations.Nullable java.util.List getCloudwatchAlarms() {
        return java.util.Optional.ofNullable((java.util.List)(software.amazon.jsii.Kernel.get(this, "cloudwatchAlarms", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.cloudwatch.Alarm.class))))).map(java.util.Collections::unmodifiableList).orElse(null);
    }

    /**
     * A fluent builder for {@link software.amazon.awsconstructs.services.apigatewaykinesisstreams.ApiGatewayToKinesisStreams}.
     */
    public static final class Builder implements software.amazon.jsii.Builder {
        /**
         * @return a new instance of {@link Builder}.
         * @param scope - represents the scope for all the resources. This parameter is required.
         * @param id - this is a a scope-unique id. This parameter is required.
         */
        public static Builder create(final software.amazon.awscdk.core.Construct scope, final java.lang.String id) {
            return new Builder(scope, id);
        }

        private final software.amazon.awscdk.core.Construct scope;
        private final java.lang.String id;
        private final software.amazon.awsconstructs.services.apigatewaykinesisstreams.ApiGatewayToKinesisStreamsProps.Builder props;

        private Builder(final software.amazon.awscdk.core.Construct scope, final java.lang.String id) {
            this.scope = scope;
            this.id = id;
            this.props = new software.amazon.awsconstructs.services.apigatewaykinesisstreams.ApiGatewayToKinesisStreamsProps.Builder();
        }

        /**
         * Optional user-provided props to override the default props for the API Gateway.
         * 

* Default: - Default properties are used. *

* @return {@code this} * @param apiGatewayProps Optional user-provided props to override the default props for the API Gateway. This parameter is required. */ public Builder apiGatewayProps(final software.amazon.awscdk.services.apigateway.RestApiProps apiGatewayProps) { this.props.apiGatewayProps(apiGatewayProps); return this; } /** * Whether to create recommended CloudWatch alarms. *

* Default: - Alarms are created *

* @return {@code this} * @param createCloudWatchAlarms Whether to create recommended CloudWatch alarms. This parameter is required. */ public Builder createCloudWatchAlarms(final java.lang.Boolean createCloudWatchAlarms) { this.props.createCloudWatchAlarms(createCloudWatchAlarms); return this; } /** * Existing instance of Kinesis Stream, providing both this and `kinesisStreamProps` will cause an error. *

* Default: - None *

* @return {@code this} * @param existingStreamObj Existing instance of Kinesis Stream, providing both this and `kinesisStreamProps` will cause an error. This parameter is required. */ public Builder existingStreamObj(final software.amazon.awscdk.services.kinesis.Stream existingStreamObj) { this.props.existingStreamObj(existingStreamObj); return this; } /** * Optional user-provided props to override the default props for the Kinesis Data Stream. *

* Default: - Default properties are used. *

* @return {@code this} * @param kinesisStreamProps Optional user-provided props to override the default props for the Kinesis Data Stream. This parameter is required. */ public Builder kinesisStreamProps(final software.amazon.awscdk.services.kinesis.StreamProps kinesisStreamProps) { this.props.kinesisStreamProps(kinesisStreamProps); return this; } /** * User provided props to override the default props for the CloudWatchLogs LogGroup. *

* Default: - Default props are used *

* @return {@code this} * @param logGroupProps User provided props to override the default props for the CloudWatchLogs LogGroup. This parameter is required. */ public Builder logGroupProps(final software.amazon.awscdk.services.logs.LogGroupProps logGroupProps) { this.props.logGroupProps(logGroupProps); return this; } /** * API Gateway request model for the PutRecord action. *

* If not provided, a default one will be created. *

* Default: - {"$schema":"http://json-schema.org/draft-04/schema#","title":"PutRecord proxy single-record payload","type":"object", * "required":["data","partitionKey"],"properties":{"data":{"type":"string"},"partitionKey":{"type":"string"}}} *

* @return {@code this} * @param putRecordRequestModel API Gateway request model for the PutRecord action. This parameter is required. */ public Builder putRecordRequestModel(final software.amazon.awscdk.services.apigateway.ModelOptions putRecordRequestModel) { this.props.putRecordRequestModel(putRecordRequestModel); return this; } /** * API Gateway request template for the PutRecord action. *

* If not provided, a default one will be used. *

* Default: - { "StreamName": "${this.kinesisStream.streamName}", "Data": "$util.base64Encode($input.json('$.data'))", * "PartitionKey": "$input.path('$.partitionKey')" } *

* @return {@code this} * @param putRecordRequestTemplate API Gateway request template for the PutRecord action. This parameter is required. */ public Builder putRecordRequestTemplate(final java.lang.String putRecordRequestTemplate) { this.props.putRecordRequestTemplate(putRecordRequestTemplate); return this; } /** * API Gateway request model for the PutRecords action. *

* If not provided, a default one will be created. *

* Default: - {"$schema":"http://json-schema.org/draft-04/schema#","title":"PutRecords proxy payload data","type":"object","required":["records"], * "properties":{"records":{"type":"array","items":{"type":"object", * "required":["data","partitionKey"],"properties":{"data":{"type":"string"},"partitionKey":{"type":"string"}}}}}} *

* @return {@code this} * @param putRecordsRequestModel API Gateway request model for the PutRecords action. This parameter is required. */ public Builder putRecordsRequestModel(final software.amazon.awscdk.services.apigateway.ModelOptions putRecordsRequestModel) { this.props.putRecordsRequestModel(putRecordsRequestModel); return this; } /** * API Gateway request template for the PutRecords action. *

* If not provided, a default one will be used. *

* Default: - { "StreamName": "${this.kinesisStream.streamName}", "Records": [ #foreach($elem in $input.path('$.records')) * { "Data": "$util.base64Encode($elem.data)", "PartitionKey": "$elem.partitionKey"}#if($foreach.hasNext),#end #end ] } *

* @return {@code this} * @param putRecordsRequestTemplate API Gateway request template for the PutRecords action. This parameter is required. */ public Builder putRecordsRequestTemplate(final java.lang.String putRecordsRequestTemplate) { this.props.putRecordsRequestTemplate(putRecordsRequestTemplate); return this; } /** * @returns a newly built instance of {@link software.amazon.awsconstructs.services.apigatewaykinesisstreams.ApiGatewayToKinesisStreams}. */ @Override public software.amazon.awsconstructs.services.apigatewaykinesisstreams.ApiGatewayToKinesisStreams build() { return new software.amazon.awsconstructs.services.apigatewaykinesisstreams.ApiGatewayToKinesisStreams( this.scope, this.id, this.props.build() ); } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy