@Generated(value="jsii-pacmak/1.73.0 (build 6faeda3)", date="2023-01-31T18:36:58.304Z") public abstract class ResourceBase extends Resource implements IResource
IResource.Jsii$Default
Modifier | Constructor and Description |
---|---|
protected |
ResourceBase(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
ResourceBase(software.amazon.jsii.JsiiObjectRef objRef) |
protected |
ResourceBase(software.constructs.Construct scope,
java.lang.String id) |
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 integration)
Defines a new method for this resource.
|
Method |
addMethod(java.lang.String httpMethod,
Integration integration,
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.
|
abstract IRestApi |
getApi()
The rest API that this resource is part of.
|
abstract CorsOptions |
getDefaultCorsPreflightOptions()
Default options for CORS preflight OPTIONS method.
|
abstract Integration |
getDefaultIntegration()
An integration to use as a default for all methods created within this API unless an integration is specified.
|
abstract MethodOptions |
getDefaultMethodOptions()
Method options to use as a default for all methods created within this API unless custom options are specified.
|
abstract IResource |
getParentResource()
The parent of this resource or undefined for the root resource.
|
abstract java.lang.String |
getPath()
The full path of this resource.
|
IResource |
getResource(java.lang.String pathPart)
Retrieves a child resource by path part.
|
abstract java.lang.String |
getResourceId()
The ID of the resource.
|
abstract RestApi |
getRestApi()
Deprecated.
- Throws an error if this Resource is not associated with an instance of `RestApi`. Use `api` instead.
|
java.lang.String |
getUrl()
Deprecated.
- Throws error in some use cases that have been enabled since this deprecation notice. Use `RestApi.urlForPath()` instead.
|
Resource |
resourceForPath(java.lang.String path)
Gets or create all resources leading up to the specified path.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyRemovalPolicy, getEnv, getStack
getNode
protected ResourceBase(software.amazon.jsii.JsiiObjectRef objRef)
protected ResourceBase(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
protected ResourceBase(software.constructs.Construct scope, java.lang.String id)
scope
- This parameter is required.id
- This parameter is required.public 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
- This parameter is required.public Method addMethod(java.lang.String httpMethod, Integration integration, MethodOptions options)
httpMethod
- This parameter is required.integration
- options
- public Method addMethod(java.lang.String httpMethod, Integration integration)
httpMethod
- This parameter is required.integration
- public Method addMethod(java.lang.String httpMethod)
httpMethod
- This parameter is required.public ProxyResource addProxy(ProxyResourceOptions options)
options
- public ProxyResource addProxy()
public Resource addResource(java.lang.String pathPart, ResourceOptions options)
pathPart
- This parameter is required.options
- public Resource addResource(java.lang.String pathPart)
pathPart
- This parameter is required.public IResource getResource(java.lang.String pathPart)
pathPart
- This parameter is required.public Resource resourceForPath(java.lang.String path)
path
- This parameter is required.public abstract 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.
public abstract java.lang.String getPath()
public abstract java.lang.String getResourceId()
@Deprecated public abstract RestApi getRestApi()
@Deprecated public java.lang.String getUrl()
public abstract CorsOptions getDefaultCorsPreflightOptions()
public abstract Integration getDefaultIntegration()
public abstract MethodOptions getDefaultMethodOptions()
public abstract IResource getParentResource()