<commit_before>'use strict';

const util = require('util')

class BinarySupport {
  constructor(serverless, options) {
    this.serverless = serverless;

    this.hooks = {
      'after:deploy:deploy': this.afterDeploy.bind(this)
    };
  }

  afterDeploy() {

    const provider = this.serverless.getProvider(this.serverless.service.provider.name);

    const apiName = this.serverless.getProvider(this.serverless.service.provider.name).naming.getApiGatewayName();
    const sdk = provider.sdk;
    sdk.config.update({region: this.serverless.service.provider.region});
<commit_msg>Fix : custom API name<commit_after>'use strict';

const util = require('util')

class BinarySupport {
  constructor(serverless, options) {
    this.serverless = serverless;

    this.hooks = {
      'after:deploy:deploy': this.afterDeploy.bind(this)
    };
  }
  getApiGatewayName(){
    if(this.serverless.service.resources && this.serverless.service.resources.Resources){
      const Resources =  this.serverless.service.resources.Resources;
        for(let key in Resources){
          if(Resources.hasOwnProperty(key)){
              if(Resources[key].Type==='AWS::ApiGateway::RestApi'
                  && Resources[key].Properties.Name){
                  return  Resources[key].Properties.Name;
              }
          }
        }
    }
    return this.serverless.getProvider(this.serverless.service.provider.name).naming.getApiGatewayName();
  }
  afterDeploy() {

    const provider = this.serverless.getProvider(this.serverless.service.provider.name);

    const apiName = this.getApiGatewayName();
    const sdk = provider.sdk;
    sdk.config.update({region: this.serverless.service.provider.region});

{'fraction_non_alphanumeric': 0.12846199175014733, 'fraction_numerical': 0.0, 'mean_word_length': 3.365038560411311, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4563293', 'n_tokens_mistral': 506, 'n_tokens_neox': 496, 'n_words': 72}