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, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable
Direct Known Subclasses:
Resource

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:02.049Z") @Stability(Stable) public abstract class ResourceBase extends Resource implements IResource
  • 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

      @Stability(Stable) @NotNull public Method addCorsPreflight(@NotNull CorsOptions options)
      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:
      addCorsPreflight in interface IResource
      Parameters:
      options - This parameter is required.
      Returns:
      a Method object
      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.

      Specified by:
      addMethod in interface IResource
      Parameters:
      httpMethod - This parameter is required.
      integration -
      options -
      Returns:
      The newly created Method object.
    • addMethod

      @Stability(Stable) @NotNull public Method addMethod(@NotNull String httpMethod, @Nullable Integration integration)
      Defines a new method for this resource.

      Specified by:
      addMethod in interface IResource
      Parameters:
      httpMethod - This parameter is required.
      integration -
      Returns:
      The newly created Method object.
    • addMethod

      @Stability(Stable) @NotNull public Method addMethod(@NotNull String httpMethod)
      Defines a new method for this resource.

      Specified by:
      addMethod in interface IResource
      Parameters:
      httpMethod - This parameter is required.
      Returns:
      The newly created Method object.
    • addProxy

      @Stability(Stable) @NotNull public ProxyResource addProxy(@Nullable ProxyResourceOptions options)
      Adds a greedy proxy resource ("{proxy+}") and an ANY method to this route.

      Specified by:
      addProxy in interface IResource
      Parameters:
      options -
    • addProxy

      @Stability(Stable) @NotNull public ProxyResource addProxy()
      Adds a greedy proxy resource ("{proxy+}") and an ANY method to this route.
      Specified by:
      addProxy in interface IResource
    • 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:
      addResource in interface IResource
      Parameters:
      pathPart - This parameter is required.
      options -
      Returns:
      A Resource object
    • addResource

      @Stability(Stable) @NotNull public Resource addResource(@NotNull String pathPart)
      Defines a new child resource where this resource is the parent.

      Specified by:
      addResource in interface IResource
      Parameters:
      pathPart - This parameter is required.
      Returns:
      A Resource object
    • getResource

      @Stability(Stable) @Nullable public IResource getResource(@NotNull String pathPart)
      Retrieves a child resource by path part.

      Specified by:
      getResource in interface IResource
      Parameters:
      pathPart - This parameter is required.
      Returns:
      the child resource or undefined if not found
    • resourceForPath

      @Stability(Stable) @NotNull public Resource resourceForPath(@NotNull String path)
      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:
      resourceForPath in interface IResource
      Parameters:
      path - This parameter is required.
      Returns:
      a new or existing resource.
    • getApi

      @Stability(Stable) @NotNull public abstract IRestApi 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.

      Specified by:
      getApi in interface IResource
    • getPath

      @Stability(Stable) @NotNull public abstract String getPath()
      The full path of this resource.
      Specified by:
      getPath in interface IResource
    • getResourceId

      @Stability(Stable) @NotNull public abstract String getResourceId()
      The ID of the resource.
      Specified by:
      getResourceId in interface IResource
    • getDefaultCorsPreflightOptions

      @Stability(Stable) @Nullable public abstract CorsOptions getDefaultCorsPreflightOptions()
      Default options for CORS preflight OPTIONS method.
      Specified by:
      getDefaultCorsPreflightOptions in interface IResource
    • getDefaultIntegration

      @Stability(Stable) @Nullable public abstract Integration getDefaultIntegration()
      An integration to use as a default for all methods created within this API unless an integration is specified.
      Specified by:
      getDefaultIntegration in interface IResource
    • getDefaultMethodOptions

      @Stability(Stable) @Nullable public abstract MethodOptions getDefaultMethodOptions()
      Method options to use as a default for all methods created within this API unless custom options are specified.
      Specified by:
      getDefaultMethodOptions in interface IResource
    • getParentResource

      @Stability(Stable) @Nullable public abstract IResource getParentResource()
      The parent of this resource or undefined for the root resource.
      Specified by:
      getParentResource in interface IResource