getApiGatewayPredefinedResources() {
    if (
      !this.serverless.service.provider.apiGateway ||
      !this.serverless.service.provider.apiGateway.restApiResources
    ) {
      return []
    }

    if (
      Array.isArray(
        this.serverless.service.provider.apiGateway.restApiResources,
      )
    ) {
      return this.serverless.service.provider.apiGateway.restApiResources
    }

    return Object.keys(
      this.serverless.service.provider.apiGateway.restApiResources,
    ).map((key) => ({
      path: key,
      resourceId:
        this.serverless.service.provider.apiGateway.restApiResources[key],
    }))
  }
Get Rest API Predefined Resources from serverless config