adwords_api/lib/adwords_api/credential_handler.rb
def validate_headers_for_server(credentials)
      client_customer_id = credentials[:client_customer_id]

      if client_customer_id and (!(client_customer_id.is_a?(Integer) or
          (client_customer_id =~ /^\d+(-\d+-\d+)?$/)))
        raise AdwordsApi::Errors::BadCredentialsError,
            'Invalid client customer ID: %s' % client_customer_id.to_s
      end

      token = credentials[:developer_token]
      if token.nil? || token.empty?
        raise AdwordsApi::Errors::BadCredentialsError,
            'Developer token is missing, check credentials.'
      end
      return nil
    end
def validate_headers_for_server(credentials)
      client_customer_id = credentials[:client_customer_id]

      if client_customer_id and (!(client_customer_id.is_a?(Integer) or
          (client_customer_id =~ /^\d+(-\d+-\d+)?$/)))
        raise AdwordsApi::Errors::BadCredentialsError,
            'Invalid client customer ID: %s' % client_customer_id.to_s
      end

      token = credentials[:developer_token]
      if token.nil? || token.empty?
        raise AdwordsApi::Errors::BadCredentialsError,
            'Developer token is missing, check credentials.'
      end
      return nil
    end
def validate_headers_for_server ( credentials ) client_customer_id = credentials [ :client_customer_id ] if client_customer_id and ( ! ( client_customer_id . is_a? ( Integer ) or ( client_customer_id =~ / \d \d \d / ) ) ) raise AdwordsApi :: Errors :: BadCredentialsError , 'Invalid client customer ID: %s' % client_customer_id . to_s end token = credentials [ :developer_token ] if token . nil? || token . empty? raise AdwordsApi :: Errors :: BadCredentialsError , 'Developer token is missing, check credentials.' end return nil end
Validates that the right credentials are being used for the chosen
 environment.

 Raises:
 - AdwordsApi::Errors:BadCredentialsError if supplied credentials are not
 valid.
Validates that the right credentials are being used for the chosen environment .