Class ProxyResource

All Implemented Interfaces:
IConstruct, IDependable, IResource, IResource, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:45.026Z") @Stability(Stable) public class ProxyResource extends Resource
Defines a {proxy+} greedy resource and an ANY method on a route.

Example:

 Resource resource;
 Function handler;
 ProxyResource proxy = resource.addProxy(ProxyResourceOptions.builder()
         .defaultIntegration(new LambdaIntegration(handler))
         // "false" will require explicitly adding methods on the `proxy` resource
         .anyMethod(true)
         .build());
 

See Also:
  • Constructor Details

    • ProxyResource

      protected ProxyResource(software.amazon.jsii.JsiiObjectRef objRef)
    • ProxyResource

      protected ProxyResource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • ProxyResource

      @Stability(Stable) public ProxyResource(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ProxyResourceProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • 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
      Overrides:
      addMethod in class ResourceBase
      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
      Overrides:
      addMethod in class ResourceBase
      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
      Overrides:
      addMethod in class ResourceBase
      Parameters:
      httpMethod - This parameter is required.
      Returns:
      The newly created Method object.
    • getAnyMethod

      @Stability(Stable) @Nullable public Method getAnyMethod()
      If props.anyMethod is true, this will be the reference to the 'ANY' method associated with this proxy resource.