<commit_before>require 'aws-sdk'

module AWS
  module Core
    class Client

      # PTF:
      class << self
        alias load_api_config_orig load_api_config

        def load_api_config(api_version)
          yaml = load_api_config_orig(api_version)

          if service_name == 'Route53'
            replace_api_version(yaml)
          end

          return yaml
        end

        private

        def replace_api_version(value)
          case value
          when String
            if value =~ /2012-12-12/
              value.gsub!(/2012-12-12/, '2013-04-01')
            end
          when Array
            value.each {|v| replace_api_version(v) }
          when Hash
            value.each {|k, v| replace_api_version(v) }
          end
        end
      end # of class method<commit_msg>fix route53 ext<commit_after>require 'aws-sdk'

module AWS
  module Core
    class Client

      # PTF:
      class << self
        alias load_api_config_orig load_api_config

        def load_api_config(api_version)
          yaml = load_api_config_orig(api_version)

          if service_name == 'Route53'
            replace_api_version(yaml)
          end

          return yaml
        end

        private

        def replace_api_version(value)
          case value
          when String
            if value =~ /2012-12-12/
              value.gsub!(/2012-12-12/, '2013-04-01')
            end
          when Array
            value.each {|v| replace_api_version(v) }
          when Hash
            value.each do |k, v|
              if k == :health_check_config
                v[:members][:search_string] = {
                  :name     => 'SearchString',
                  :type     => :string,
                  :position => 5,
                }
              end

              replace_api_version(v)
            end
          end
        end
      end # of class method
{'fraction_non_alphanumeric': 0.07472178060413355, 'fraction_numerical': 0.029146793852676205, 'mean_word_length': 1.3279901356350186, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 6, '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': '4125512', 'n_tokens_mistral': 580, 'n_tokens_neox': 523, 'n_words': 126}