software.aws.awsprototypingsdk.openapigateway.OpenApiGatewayRestApi Maven / Gradle / Ivy
Show all versions of open-api-gateway Show documentation
package software.aws.awsprototypingsdk.openapigateway;
/**
* (experimental) A construct for creating an api gateway rest api based on the definition in the OpenAPI spec.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.82.0 (build 2d2ddd7)", date = "2023-08-15T05:38:04.615Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = software.aws.awsprototypingsdk.openapigateway.$Module.class, fqn = "@aws-prototyping-sdk/open-api-gateway.OpenApiGatewayRestApi")
public class OpenApiGatewayRestApi extends software.constructs.Construct {
protected OpenApiGatewayRestApi(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected OpenApiGatewayRestApi(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param scope This parameter is required.
* @param id This parameter is required.
* @param props This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public OpenApiGatewayRestApi(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull software.aws.awsprototypingsdk.openapigateway.OpenApiGatewayRestApiProps 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") });
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.apigateway.SpecRestApi getApi() {
return software.amazon.jsii.Kernel.get(this, "api", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.apigateway.SpecRestApi.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.wafv2.CfnIPSet getIpSet() {
return software.amazon.jsii.Kernel.get(this, "ipSet", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.wafv2.CfnIPSet.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.wafv2.CfnWebACL getWebAcl() {
return software.amazon.jsii.Kernel.get(this, "webAcl", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.wafv2.CfnWebACL.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.wafv2.CfnWebACLAssociation getWebAclAssociation() {
return software.amazon.jsii.Kernel.get(this, "webAclAssociation", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.wafv2.CfnWebACLAssociation.class));
}
/**
* (experimental) A fluent builder for {@link software.aws.awsprototypingsdk.openapigateway.OpenApiGatewayRestApi}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param scope This parameter is required.
* @param id This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create(final software.constructs.Construct scope, final java.lang.String id) {
return new Builder(scope, id);
}
private final software.constructs.Construct scope;
private final java.lang.String id;
private final software.aws.awsprototypingsdk.openapigateway.OpenApiGatewayRestApiProps.Builder props;
private Builder(final software.constructs.Construct scope, final java.lang.String id) {
this.scope = scope;
this.id = id;
this.props = new software.aws.awsprototypingsdk.openapigateway.OpenApiGatewayRestApiProps.Builder();
}
/**
* Automatically configure an AWS CloudWatch role for API Gateway.
*
* Default: - false if `@aws-cdk/aws-apigateway:disableCloudWatchRole` is enabled, true otherwise
*
* @return {@code this}
* @param cloudWatchRole Automatically configure an AWS CloudWatch role for API Gateway. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder cloudWatchRole(final java.lang.Boolean cloudWatchRole) {
this.props.cloudWatchRole(cloudWatchRole);
return this;
}
/**
* Indicates if a Deployment should be automatically created for this API, and recreated when the API model (resources, methods) changes.
*
* Since API Gateway deployments are immutable, When this option is enabled
* (by default), an AWS::ApiGateway::Deployment resource will automatically
* created with a logical ID that hashes the API model (methods, resources
* and options). This means that when the model changes, the logical ID of
* this CloudFormation resource will change, and a new deployment will be
* created.
*
* If this is set, latestDeployment
will refer to the Deployment
object
* and deploymentStage
will refer to a Stage
that points to this
* deployment. To customize the stage options, use the deployOptions
* property.
*
* A CloudFormation Output will also be defined with the root URL endpoint
* of this REST API.
*
* Default: true
*
* @return {@code this}
* @param deploy Indicates if a Deployment should be automatically created for this API, and recreated when the API model (resources, methods) changes. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder deploy(final java.lang.Boolean deploy) {
this.props.deploy(deploy);
return this;
}
/**
* Options for the API Gateway stage that will always point to the latest deployment when deploy
is enabled.
*
* If deploy
is disabled,
* this value cannot be set.
*
* Default: - Based on defaults of `StageOptions`.
*
* @return {@code this}
* @param deployOptions Options for the API Gateway stage that will always point to the latest deployment when deploy
is enabled. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder deployOptions(final software.amazon.awscdk.services.apigateway.StageOptions deployOptions) {
this.props.deployOptions(deployOptions);
return this;
}
/**
* A description of the RestApi construct.
*
* Default: - 'Automatically created by the RestApi construct'
*
* @return {@code this}
* @param description A description of the RestApi construct. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder description(final java.lang.String description) {
this.props.description(description);
return this;
}
/**
* Specifies whether clients can invoke the API using the default execute-api endpoint.
*
* To require that clients use a custom domain name to invoke the
* API, disable the default endpoint.
*
* Default: false
*
* @return {@code this}
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html
* @param disableExecuteApiEndpoint Specifies whether clients can invoke the API using the default execute-api endpoint. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder disableExecuteApiEndpoint(final java.lang.Boolean disableExecuteApiEndpoint) {
this.props.disableExecuteApiEndpoint(disableExecuteApiEndpoint);
return this;
}
/**
* Configure a custom domain name and map it to this API.
*
* Default: - no domain name is defined, use `addDomainName` or directly define a `DomainName`.
*
* @return {@code this}
* @param domainName Configure a custom domain name and map it to this API. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder domainName(final software.amazon.awscdk.services.apigateway.DomainNameOptions domainName) {
this.props.domainName(domainName);
return this;
}
/**
* Export name for the CfnOutput containing the API endpoint.
*
* Default: - when no export name is given, output will be created without export
*
* @return {@code this}
* @param endpointExportName Export name for the CfnOutput containing the API endpoint. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder endpointExportName(final java.lang.String endpointExportName) {
this.props.endpointExportName(endpointExportName);
return this;
}
/**
* A list of the endpoint types of the API.
*
* Use this property when creating
* an API.
*
* Default: EndpointType.EDGE
*
* @return {@code this}
* @param endpointTypes A list of the endpoint types of the API. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder endpointTypes(final java.util.List extends software.amazon.awscdk.services.apigateway.EndpointType> endpointTypes) {
this.props.endpointTypes(endpointTypes);
return this;
}
/**
* Indicates whether to roll back the resource if a warning occurs while API Gateway is creating the RestApi resource.
*
* Default: false
*
* @return {@code this}
* @param failOnWarnings Indicates whether to roll back the resource if a warning occurs while API Gateway is creating the RestApi resource. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder failOnWarnings(final java.lang.Boolean failOnWarnings) {
this.props.failOnWarnings(failOnWarnings);
return this;
}
/**
* Custom header parameters for the request.
*
* Default: - No parameters.
*
* @return {@code this}
* @see https://docs.aws.amazon.com/cli/latest/reference/apigateway/import-rest-api.html
* @param parameters Custom header parameters for the request. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder parameters(final java.util.Map parameters) {
this.props.parameters(parameters);
return this;
}
/**
* A policy document that contains the permissions for this RestApi.
*
* Default: - No policy.
*
* @return {@code this}
* @param policy A policy document that contains the permissions for this RestApi. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder policy(final software.amazon.awscdk.services.iam.PolicyDocument policy) {
this.props.policy(policy);
return this;
}
/**
* A name for the API Gateway RestApi resource.
*
* Default: - ID of the RestApi construct.
*
* @return {@code this}
* @param restApiName A name for the API Gateway RestApi resource. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder restApiName(final java.lang.String restApiName) {
this.props.restApiName(restApiName);
return this;
}
/**
* Retains old deployment resources when the API changes.
*
* This allows
* manually reverting stages to point to old deployments via the AWS
* Console.
*
* Default: false
*
* @return {@code this}
* @param retainDeployments Retains old deployment resources when the API changes. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder retainDeployments(final java.lang.Boolean retainDeployments) {
this.props.retainDeployments(retainDeployments);
return this;
}
/**
* (experimental) A mapping of API operation to its integration.
*
* @return {@code this}
* @param integrations A mapping of API operation to its integration. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder integrations(final java.util.Map integrations) {
this.props.integrations(integrations);
return this;
}
/**
* (experimental) Details about each operation.
*
* @return {@code this}
* @param operationLookup Details about each operation. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder operationLookup(final java.util.Map operationLookup) {
this.props.operationLookup(operationLookup);
return this;
}
/**
* (experimental) Cross Origin Resource Sharing options for the API.
*
* @return {@code this}
* @param corsOptions Cross Origin Resource Sharing options for the API. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder corsOptions(final software.amazon.awscdk.services.apigateway.CorsOptions corsOptions) {
this.props.corsOptions(corsOptions);
return this;
}
/**
* (experimental) The default authorizer to use for your api.
*
* When omitted, no default authorizer is used.
* Authorizers specified at the integration level will override this for that operation.
*
* @return {@code this}
* @param defaultAuthorizer The default authorizer to use for your api. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder defaultAuthorizer(final software.aws.awsprototypingsdk.openapigateway.Authorizer defaultAuthorizer) {
this.props.defaultAuthorizer(defaultAuthorizer);
return this;
}
/**
* (experimental) The parsed OpenAPI specification.
*
* @return {@code this}
* @param spec The parsed OpenAPI specification. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder spec(final java.lang.Object spec) {
this.props.spec(spec);
return this;
}
/**
* (experimental) Path to the JSON open api spec.
*
* @return {@code this}
* @param specPath Path to the JSON open api spec. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder specPath(final java.lang.String specPath) {
this.props.specPath(specPath);
return this;
}
/**
* (experimental) Options for the AWS WAF v2 WebACL associated with the api.
*
* By default, a Web ACL with the AWS default managed
* rule set will be associated with the API. These options may disable or override the defaults.
*
* @return {@code this}
* @param webAclOptions Options for the AWS WAF v2 WebACL associated with the api. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder webAclOptions(final software.aws.awsprototypingsdk.openapigateway.OpenApiGatewayWebAclOptions webAclOptions) {
this.props.webAclOptions(webAclOptions);
return this;
}
/**
* @return a newly built instance of {@link software.aws.awsprototypingsdk.openapigateway.OpenApiGatewayRestApi}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public software.aws.awsprototypingsdk.openapigateway.OpenApiGatewayRestApi build() {
return new software.aws.awsprototypingsdk.openapigateway.OpenApiGatewayRestApi(
this.scope,
this.id,
this.props.build()
);
}
}
}