Class Resource.Builder

java.lang.Object
software.amazon.awscdk.services.apigateway.Resource.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<Resource>
Enclosing class:
Resource

@Stability(Stable) public static final class Resource.Builder extends Object implements software.amazon.jsii.Builder<Resource>
A fluent builder for Resource.
  • Method Details

    • create

      @Stability(Stable) public static Resource.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of Resource.Builder.
    • defaultCorsPreflightOptions

      @Stability(Stable) public Resource.Builder defaultCorsPreflightOptions(CorsOptions defaultCorsPreflightOptions)
      Adds a CORS preflight OPTIONS method to this resource and all child resources.

      You can add CORS at the resource-level using addCorsPreflight.

      Default: - CORS is disabled

      Parameters:
      defaultCorsPreflightOptions - Adds a CORS preflight OPTIONS method to this resource and all child resources. This parameter is required.
      Returns:
      this
    • defaultIntegration

      @Stability(Stable) public Resource.Builder defaultIntegration(Integration defaultIntegration)
      An integration to use as a default for all methods created within this API unless an integration is specified.

      Default: - Inherited from parent.

      Parameters:
      defaultIntegration - An integration to use as a default for all methods created within this API unless an integration is specified. This parameter is required.
      Returns:
      this
    • defaultMethodOptions

      @Stability(Stable) public Resource.Builder defaultMethodOptions(MethodOptions defaultMethodOptions)
      Method options to use as a default for all methods created within this API unless custom options are specified.

      Default: - Inherited from parent.

      Parameters:
      defaultMethodOptions - Method options to use as a default for all methods created within this API unless custom options are specified. This parameter is required.
      Returns:
      this
    • parent

      @Stability(Stable) public Resource.Builder parent(IResource parent)
      The parent resource of this resource.

      You can either pass another Resource object or a RestApi object here.

      Parameters:
      parent - The parent resource of this resource. This parameter is required.
      Returns:
      this
    • pathPart

      @Stability(Stable) public Resource.Builder pathPart(String pathPart)
      A path name for the resource.

      Parameters:
      pathPart - A path name for the resource. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public Resource build()
      Specified by:
      build in interface software.amazon.jsii.Builder<Resource>
      Returns:
      a newly built instance of Resource.