Class ResourceBase
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.apigateway.ResourceBase
- All Implemented Interfaces:
IResource,IResource,IResourceRef,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
- Direct Known Subclasses:
Resource
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-24T13:34:30.369Z")
@Stability(Stable)
public abstract class ResourceBase
extends Resource
implements IResource
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.apigateway.IResource
IResource.Jsii$Default -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedResourceBase(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedResourceBase(software.amazon.jsii.JsiiObjectRef objRef) protectedResourceBase(software.constructs.Construct scope, String id) -
Method Summary
Modifier and TypeMethodDescriptionaddCorsPreflight(CorsOptions options) Adds an OPTIONS method to this resource which responds to Cross-Origin Resource Sharing (CORS) preflight requests.Defines a new method for this resource.addMethod(String httpMethod, Integration integration) Defines a new method for this resource.addMethod(String httpMethod, Integration integration, MethodOptions options) Defines a new method for this resource.addProxy()Adds a greedy proxy resource ("{proxy+}") and an ANY method to this route.addProxy(ProxyResourceOptions options) Adds a greedy proxy resource ("{proxy+}") and an ANY method to this route.addResource(String pathPart) Defines a new child resource where this resource is the parent.addResource(String pathPart, ResourceOptions options) Defines a new child resource where this resource is the parent.abstract IRestApigetApi()The rest API that this resource is part of.abstract CorsOptionsDefault options for CORS preflight OPTIONS method.abstract IntegrationAn integration to use as a default for all methods created within this API unless an integration is specified.abstract MethodOptionsMethod options to use as a default for all methods created within this API unless custom options are specified.abstract IResourceThe parent of this resource or undefined for the root resource.abstract StringgetPath()The full path of this resource.getResource(String pathPart) Retrieves a child resource by path part.abstract StringThe ID of the resource.A reference to a Resource resource.resourceForPath(String path) Gets or create all resources leading up to the specified path.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
ResourceBase
protected ResourceBase(software.amazon.jsii.JsiiObjectRef objRef) -
ResourceBase
protected ResourceBase(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
ResourceBase
@Stability(Stable) protected ResourceBase(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope- This parameter is required.id- This parameter is required.
-
-
Method Details
-
addCorsPreflight
Adds an OPTIONS method to this resource which responds to Cross-Origin Resource Sharing (CORS) preflight requests.Cross-Origin Resource Sharing (CORS) is a mechanism that uses additional HTTP headers to tell browsers to give a web application running at one origin, access to selected resources from a different origin. A web application executes a cross-origin HTTP request when it requests a resource that has a different origin (domain, protocol, or port) from its own.
- Specified by:
addCorsPreflightin interfaceIResource- Parameters:
options- This parameter is required.- Returns:
- a
Methodobject - See Also:
-
addMethod
@Stability(Stable) @NotNull public Method addMethod(@NotNull String httpMethod, @Nullable Integration integration, @Nullable MethodOptions options) Defines a new method for this resource. -
addMethod
@Stability(Stable) @NotNull public Method addMethod(@NotNull String httpMethod, @Nullable Integration integration) Defines a new method for this resource. -
addMethod
Defines a new method for this resource. -
addProxy
Adds a greedy proxy resource ("{proxy+}") and an ANY method to this route. -
addProxy
Adds a greedy proxy resource ("{proxy+}") and an ANY method to this route. -
addResource
@Stability(Stable) @NotNull public Resource addResource(@NotNull String pathPart, @Nullable ResourceOptions options) Defines a new child resource where this resource is the parent.- Specified by:
addResourcein interfaceIResource- Parameters:
pathPart- This parameter is required.options-- Returns:
- A Resource object
-
addResource
Defines a new child resource where this resource is the parent.- Specified by:
addResourcein interfaceIResource- Parameters:
pathPart- This parameter is required.- Returns:
- A Resource object
-
getResource
Retrieves a child resource by path part.- Specified by:
getResourcein interfaceIResource- Parameters:
pathPart- This parameter is required.- Returns:
- the child resource or undefined if not found
-
resourceForPath
Gets or create all resources leading up to the specified path.- Path may only start with "/" if this method is called on the root resource.
- All resources are created using default options.
- Specified by:
resourceForPathin interfaceIResource- Parameters:
path- This parameter is required.- Returns:
- a new or existing resource.
-
getApi
The rest API that this resource is part of.The reason we need the RestApi object itself and not just the ID is because the model is being tracked by the top-level RestApi object for the purpose of calculating it's hash to determine the ID of the deployment. This allows us to automatically update the deployment when the model of the REST API changes.
-
getPath
The full path of this resource. -
getResourceId
The ID of the resource.- Specified by:
getResourceIdin interfaceIResource
-
getResourceRef
A reference to a Resource resource.- Specified by:
getResourceRefin interfaceIResourceRef
-
getDefaultCorsPreflightOptions
Default options for CORS preflight OPTIONS method.- Specified by:
getDefaultCorsPreflightOptionsin interfaceIResource
-
getDefaultIntegration
An integration to use as a default for all methods created within this API unless an integration is specified.- Specified by:
getDefaultIntegrationin interfaceIResource
-
getDefaultMethodOptions
Method options to use as a default for all methods created within this API unless custom options are specified.- Specified by:
getDefaultMethodOptionsin interfaceIResource
-
getParentResource
The parent of this resource or undefined for the root resource.- Specified by:
getParentResourcein interfaceIResource
-