<commit_before>module Lobbyist
  class CompanyUser < Lobbyist::Base

    attr_accessor :company_user_id, :company_id, :date_added, :email, :first_name, :last_name,
      :is_active, :is_manager, :primary_contact, :accepts_terms, :sugar_contact_id

    def self.list(params = {})
      create_from_response(get('/v1/company_users.json', params))
    end
    
    def self.find(id)
      create_from_response(get("/v1/company_users/#{id}.json"))
    end
    
    def self.create(company_id, params = {})
      create_from_response(post("/v1/company_users.json", {'company_id' => company_id, 'company_user' => params}))
    end
    
    def self.update(id, company_id, params = {})
      create_from_response(put("/v1/company_users/#{id}.json", {'company_id' => company_id, 'company_user' => params}))
    end

    def self.destroy(id, company_id)
      create_from_response(delete("/v1/company_users/#{id}.json", {'company_id' => company_id}))
    end

    def self.primary(company_id)
      create_from_response(get("/v1/company_users/primary.json", {'company_id' => company_id}))
    end

    def self.reset_password(email)
      create_from_response(put("/v1/company_users/reset_password.json", {'reset_email' => email}))
    end
  end
end<commit_msg>[addresses #55425192] Added find_by_confirmation_key. Needed the new find_by_confirmation_key api call in order to process password resets for company users.<commit_after>module Lobbyist
  class CompanyUser < Lobbyist::Base

    attr_accessor :company_user_id, :company_id, :date_added, :email, :first_name, :last_name,
      :is_active, :is_manager, :primary_contact, :accepts_terms, :sugar_contact_id

    def self.list(params = {})
      create_from_response(get('/v1/company_users.json', params))
    end
    
    def self.find(id)
      create_from_response(get("/v1/company_users/#{id}.json"))
    end
    
    def self.create(company_id, params = {})
      create_from_response(post("/v1/company_users.json", {'company_id' => company_id, 'company_user' => params}))
    end
    
    def self.update(id, company_id, params = {})
      create_from_response(put("/v1/company_users/#{id}.json", {'company_id' => company_id, 'company_user' => params}))
    end

    def self.destroy(id, company_id)
      create_from_response(delete("/v1/company_users/#{id}.json", {'company_id' => company_id}))
    end

    def self.primary(company_id)
      create_from_response(get("/v1/company_users/primary.json", {'company_id' => company_id}))
    end

    def self.reset_password(email)
      create_from_response(put("/v1/company_users/reset_password.json", {'reset_email' => email}))
    end
    
    def self.find_by_confirmation_key(key)
      create_from_response(get("/v1/company_users/find_by_confirmation_key/#{key}.json"))
    end
  end
end
{'fraction_non_alphanumeric': 0.1395848246241947, 'fraction_numerical': 0.0082319255547602, 'mean_word_length': 4.195167286245353, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '4123897', 'n_tokens_mistral': 950, 'n_tokens_neox': 936, 'n_words': 153}