lib/plugins/aws/provider/awsProvider.js/AwsProvider/getApiGatewayPredefinedResources
class AwsProvider:  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;
    }

    if (typeof this.serverless.service.provider.apiGateway.restApiResources !== 'object') {
      throw new Error('REST API resource must be an array of object');
    }

    return Object.keys(this.serverless.service.provider.apiGateway.restApiResources)
      .map((key) => ({
        path: key,
        resourceId: this.serverless.service.provider.apiGateway.restApiResources[key],
      }));
  }