@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:47.640Z") public interface IResource extends IResource
Modifier and Type | Interface and Description |
---|---|
static interface |
IResource.Jsii$Default
Internal default implementation for
IResource . |
static class |
IResource.Jsii$Proxy
A proxy class which represents a concrete javascript instance of this type.
|
Modifier and Type | Method and Description |
---|---|
Method |
addCorsPreflight(CorsOptions options)
Adds an OPTIONS method to this resource which responds to Cross-Origin Resource Sharing (CORS) preflight requests.
|
Method |
addMethod(java.lang.String httpMethod)
Defines a new method for this resource.
|
Method |
addMethod(java.lang.String httpMethod,
Integration target)
Defines a new method for this resource.
|
Method |
addMethod(java.lang.String httpMethod,
Integration target,
MethodOptions options)
Defines a new method for this resource.
|
ProxyResource |
addProxy()
Adds a greedy proxy resource ("{proxy+}") and an ANY method to this route.
|
ProxyResource |
addProxy(ProxyResourceOptions options)
Adds a greedy proxy resource ("{proxy+}") and an ANY method to this route.
|
Resource |
addResource(java.lang.String pathPart)
Defines a new child resource where this resource is the parent.
|
Resource |
addResource(java.lang.String pathPart,
ResourceOptions options)
Defines a new child resource where this resource is the parent.
|
IRestApi |
getApi()
The rest API that this resource is part of.
|
default CorsOptions |
getDefaultCorsPreflightOptions()
Default options for CORS preflight OPTIONS method.
|
default Integration |
getDefaultIntegration()
An integration to use as a default for all methods created within this API unless an integration is specified.
|
default MethodOptions |
getDefaultMethodOptions()
Method options to use as a default for all methods created within this API unless custom options are specified.
|
default IResource |
getParentResource()
The parent of this resource or undefined for the root resource.
|
java.lang.String |
getPath()
The full path of this resource.
|
IResource |
getResource(java.lang.String pathPart)
Retrieves a child resource by path part.
|
java.lang.String |
getResourceId()
The ID of the resource.
|
RestApi |
getRestApi()
Deprecated.
- Throws an error if this Resource is not associated with an instance of `RestApi`. Use `api` instead.
|
Resource |
resourceForPath(java.lang.String path)
Gets or create all resources leading up to the specified path.
|
applyRemovalPolicy, getEnv, getStack
getNode
IRestApi getApi()
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.
java.lang.String getPath()
java.lang.String getResourceId()
@Deprecated RestApi getRestApi()
default CorsOptions getDefaultCorsPreflightOptions()
default Integration getDefaultIntegration()
default MethodOptions getDefaultMethodOptions()
default IResource getParentResource()
Method addCorsPreflight(CorsOptions options)
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.
options
- CORS options. This parameter is required.Method addMethod(java.lang.String httpMethod, Integration target, MethodOptions options)
httpMethod
- The HTTP method. This parameter is required.target
- The target backend integration for this method.options
- Method options, such as authentication.Method addMethod(java.lang.String httpMethod, Integration target)
httpMethod
- The HTTP method. This parameter is required.target
- The target backend integration for this method.Method addMethod(java.lang.String httpMethod)
httpMethod
- The HTTP method. This parameter is required.ProxyResource addProxy(ProxyResourceOptions options)
options
- Default integration and method options.ProxyResource addProxy()
Resource addResource(java.lang.String pathPart, ResourceOptions options)
pathPart
- The path part for the child resource. This parameter is required.options
- Resource options.Resource addResource(java.lang.String pathPart)
pathPart
- The path part for the child resource. This parameter is required.IResource getResource(java.lang.String pathPart)
pathPart
- The path part of the child resource. This parameter is required.Resource resourceForPath(java.lang.String path)
path
- The relative path. This parameter is required.