You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: aws.rb
    path of file: ./repos/newrelic-ruby-agent/lib/new_relic/agent/utilization
    
    the code of the file until where you have to start completion: # This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

require 'new_relic/agent/utilization/vendor'

module NewRelic
  module Agent
    module Utilization
      class AWS < Vendor
        IMDS_BASE_URL = 'http://169.254.169.254/latest'.freeze
        IMDS_KEYS = %w[instanceId inst
    
          def imds_token
            uri = URI.parse("#{IMDS_BASE_URL}/api/token")
            http = Net::HTTP.new(uri.hostname)
            http.open_timeout = TOKEN_OPEN_TIMEOUT_SECS
            http.read_timeout = TOKEN_READ_TIMEOUT_SECS
            response = http.send_request('PUT',
              uri.path,
              '',
              {'X-aws-ec2-metadata-token-ttl-seconds' => IMDS_TOKEN_TTL_SECS})
            unless response.code == Vendor::SUCCESS
              NewRelic::Agent.logger.debug('Failed to obtain an AWS token for use with IMDS - encountered ' \
                                           "#{response.class} with HTTP response code #{response.code} - " \
                                           'assuming non AWS')
              return
            end