<commit_before># Encapsulates an organization profile, primarily used for in app store
class Podio::OrganizationProfile < ActivePodio::Base
  include ActivePodio::Updatable

  property :org_id, :integer
  property :avatar, :integer
  property :image, :hash
  property :name, :string
  property :mail, :array
  property :phone, :array
  property :url, :array
  property :address, :array
  property :city, :string
  property :country, :string
  property :about, :string

  alias_method :id, :org_id
  alias_method :logo, :avatar
  alias_method :logo=, :avatar=

  def create
    self.class.create(self.org_id, self.attributes)
  end

  def update
    self.class.update(self.org_id, self.attributes)
  end

  def destroy
    self.class.delete(self.org_id)
  end

  handle_api_errors_for :create, :update # Call must be made after the methods to handle have been defined  

  class << self
    def find(org_id)
      member Podio.connection.get("/org/#{org_id}/appstore").body
    end

    def create(org_id, attributes)
      response = Podio.connection.post do |req|
        req.url "/org/#{org_id}/appstore"
        req.body = attributes
      end

      response.body
    end

    def update(org_id, attributes)
      response = Podio.connection.put do |req|
        req.url "/org/#{org_id}/appstore"
        req.body = attributes
      end
      response.status
    end

    def delete(org_id)
      Podio.connection.delete("/org/#{org_id}/appstore").status
    end
  end

end
<commit_msg>Add find_by_url for org profile<commit_after># Encapsulates an organization profile, primarily used for in app store
class Podio::OrganizationProfile < ActivePodio::Base
  include ActivePodio::Updatable

  property :org_id, :integer
  property :avatar, :integer
  property :image, :hash
  property :name, :string
  property :mail, :array
  property :phone, :array
  property :url, :array
  property :address, :array
  property :city, :string
  property :country, :string
  property :about, :string

  alias_method :id, :org_id
  alias_method :logo, :avatar
  alias_method :logo=, :avatar=

  def create
    self.class.create(self.org_id, self.attributes)
  end

  def update
    self.class.update(self.org_id, self.attributes)
  end

  def destroy
    self.class.delete(self.org_id)
  end

  handle_api_errors_for :create, :update # Call must be made after the methods to handle have been defined

  class << self
    def find(org_id)
      member Podio.connection.get("/org/#{org_id}/appstore").body
    end

    def find_by_url(url_label)
      member Podio.connection.get("/app_store/org/#{url_label}/profile").body
    end

    def create(org_id, attributes)
      response = Podio.connection.post do |req|
        req.url "/org/#{org_id}/appstore"
        req.body = attributes
      end

      response.body
    end

    def update(org_id, attributes)
      response = Podio.connection.put do |req|
        req.url "/org/#{org_id}/appstore"
        req.body = attributes
      end
      response.status
    end

    def delete(org_id)
      Podio.connection.delete("/org/#{org_id}/appstore").status
    end
  end

end

{'fraction_non_alphanumeric': 0.10211946050096339, 'fraction_numerical': 0.0, 'mean_word_length': 3.1533333333333333, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, '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': '398985', 'n_tokens_mistral': 1005, 'n_tokens_neox': 981, 'n_words': 265}