Class ProxyResource

java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IResource, IResource, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.94.0 (build b380f01)", date="2024-03-01T20:58:18.333Z") @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.