<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 Array
            value.each {|v| replace_api_version(v) }
          when Hash
            value.each do |k, v|
              case k
              when :health_check_config
                {
                  :request_interval => {
                    :name     => 'RequestInterval',
                    :type     => :integer,
                    :position => 6,
                  },
                  :failure_threshold => {
                    :name     => 'FailureThreshold',
                    :type     => :integer,
                    :position => 7,
                  },
                }.each {|name, attrs|
                  v[:members][name] = attrs
                }
              when 'HealthCheckConfig'
                {
                  'RequestInterval'  => {:type => :integer},
                  'FailureThreshold' => {:type => :integer},
                }.each {|name, attrs|
                  v[:children][name] = attrs
                }
              end

              replace_api_version(v)
            end
          end
        end
      end # of class method

    end # Client
  end # Core

  class Route53

    # http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region
    S3_WEBSITE_ENDPOINTS = {
      's3-website-us-east-1.amazonaws.com'      => 'Z3AQBSTGFYJSTF',
      's3-website-us-west-2.amazonaws.com'      => 'Z3BJ6K6RIION7M',
      's3-website-us-west-1.amazonaws.com'      => 'Z2F56UZL2M1ACD',
      's3-website-eu-west-1.amazonaws.com'      => 'Z1BKCTXD74EZPE',
      's3-website-ap-southeast-1.amazonaws.com' => 'Z3O0J2DXBE1FTB',
      's3-website-ap-southeast-2.amazonaws.com' => 'Z1WCIGYICN2BYD',
      's3-website-ap-northeast-1.amazonaws.com' => 'Z2M4EHUR26P7ZW',
      's3-website-sa-east-1.amazonaws.com'      => 'Z7KQH4QJS55SO',
      's3-website-us-gov-west-1.amazonaws.com'  => 'Z31GFT0UA1I2HV',
    }

    # http://docs.aws.amazon.com/Route53/latest/APIReference/API_ChangeResourceRecordSets.html
    CF_HOSTED_ZONE_ID = 'Z2FDTNDATAQYW2'

    class << self
      def dns_name_to_alias_target(name, hosted_zone_id, hosted_zone_name)
        hosted_zone_name = hosted_zone_name.sub(/\.\Z/, '')<commit_msg>Remove core ext<commit_after>require 'aws-sdk'

module AWS
  class Route53

    # http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region
    S3_WEBSITE_ENDPOINTS = {
      's3-website-us-east-1.amazonaws.com'      => 'Z3AQBSTGFYJSTF',
      's3-website-us-west-2.amazonaws.com'      => 'Z3BJ6K6RIION7M',
      's3-website-us-west-1.amazonaws.com'      => 'Z2F56UZL2M1ACD',
      's3-website-eu-west-1.amazonaws.com'      => 'Z1BKCTXD74EZPE',
      's3-website-ap-southeast-1.amazonaws.com' => 'Z3O0J2DXBE1FTB',
      's3-website-ap-southeast-2.amazonaws.com' => 'Z1WCIGYICN2BYD',
      's3-website-ap-northeast-1.amazonaws.com' => 'Z2M4EHUR26P7ZW',
      's3-website-sa-east-1.amazonaws.com'      => 'Z7KQH4QJS55SO',
      's3-website-us-gov-west-1.amazonaws.com'  => 'Z31GFT0UA1I2HV',
    }

    # http://docs.aws.amazon.com/Route53/latest/APIReference/API_ChangeResourceRecordSets.html
    CF_HOSTED_ZONE_ID = 'Z2FDTNDATAQYW2'

    class << self
      def dns_name_to_alias_target(name, hosted_zone_id, hosted_zone_name)
        hosted_zone_name = hosted_zone_name.sub(/\.\Z/, '')
{'fraction_non_alphanumeric': 0.12707774798927615, 'fraction_numerical': 0.032707774798927614, 'mean_word_length': 1.856814701378254, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 33, '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': '6248534', 'n_tokens_mistral': 1395, 'n_tokens_neox': 1314, 'n_words': 163}