Class ResourceBase
Inherited Members
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public abstract class ResourceBase : Resource, IResource, IResource
Syntax (vb)
Public MustInherit Class ResourceBase
Inherits Resource
Implements IResource, IResource
Synopsis
Constructors
ResourceBase(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
ResourceBase(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
ResourceBase(Construct, String) |
Properties
Api | The rest API that this resource is part of. |
DefaultCorsPreflightOptions | Default options for CORS preflight OPTIONS method. |
DefaultIntegration | An integration to use as a default for all methods created within this API unless an integration is specified. |
DefaultMethodOptions | Method options to use as a default for all methods created within this API unless custom options are specified. |
ParentResource | The parent of this resource or undefined for the root resource. |
Path | The full path of this resource. |
ResourceId | The ID of the resource. |
Methods
AddCorsPreflight(ICorsOptions) | Adds an OPTIONS method to this resource which responds to Cross-Origin Resource Sharing (CORS) preflight requests. |
AddMethod(String, Integration, IMethodOptions) | Defines a new method for this resource. |
AddProxy(IProxyResourceOptions) | Adds a greedy proxy resource ("{proxy+}") and an ANY method to this route. |
AddResource(String, IResourceOptions) | Defines a new child resource where this resource is the parent. |
GetResource(String) | Retrieves a child resource by path part. |
ResourceForPath(String) | Gets or create all resources leading up to the specified path. |
Constructors
ResourceBase(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected ResourceBase(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
ResourceBase(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected ResourceBase(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
ResourceBase(Construct, String)
protected ResourceBase(Construct scope, string id)
Parameters
- scope Constructs.Construct
- id System.String
Properties
Api
The rest API that this resource is part of.
public abstract IRestApi Api { get; }
Property Value
Remarks
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.
DefaultCorsPreflightOptions
Default options for CORS preflight OPTIONS method.
public abstract ICorsOptions DefaultCorsPreflightOptions { get; }
Property Value
DefaultIntegration
An integration to use as a default for all methods created within this API unless an integration is specified.
public abstract Integration DefaultIntegration { get; }
Property Value
DefaultMethodOptions
Method options to use as a default for all methods created within this API unless custom options are specified.
public abstract IMethodOptions DefaultMethodOptions { get; }
Property Value
ParentResource
The parent of this resource or undefined for the root resource.
public abstract IResource ParentResource { get; }
Property Value
Path
The full path of this resource.
public abstract string Path { get; }
Property Value
System.String
ResourceId
The ID of the resource.
public abstract string ResourceId { get; }
Property Value
System.String
Methods
AddCorsPreflight(ICorsOptions)
Adds an OPTIONS method to this resource which responds to Cross-Origin Resource Sharing (CORS) preflight requests.
public virtual Method AddCorsPreflight(ICorsOptions options)
Parameters
- options ICorsOptions
Returns
Remarks
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.
AddMethod(String, Integration, IMethodOptions)
Defines a new method for this resource.
public virtual Method AddMethod(string httpMethod, Integration integration = null, IMethodOptions options = null)
Parameters
- httpMethod System.String
- integration Integration
- options IMethodOptions
Returns
AddProxy(IProxyResourceOptions)
Adds a greedy proxy resource ("{proxy+}") and an ANY method to this route.
public virtual ProxyResource AddProxy(IProxyResourceOptions options = null)
Parameters
- options IProxyResourceOptions
Returns
AddResource(String, IResourceOptions)
Defines a new child resource where this resource is the parent.
public virtual Resource AddResource(string pathPart, IResourceOptions options = null)
Parameters
- pathPart System.String
- options IResourceOptions
Returns
GetResource(String)
Retrieves a child resource by path part.
public virtual IResource GetResource(string pathPart)
Parameters
- pathPart System.String
Returns
ResourceForPath(String)
Gets or create all resources leading up to the specified path.
public virtual Resource ResourceForPath(string path)
Parameters
- path System.String
Returns