Sha256: 8035bef90addd0b10fee96bd5f483f3b77160e854a5fef7d6e156219700ef52f

Contents?: true

Size: 1.38 KB

Versions: 11

Compression:

Stored size: 1.38 KB

Contents

module Hominid
  module Security
    
    # Add an API Key to your account. We will generate a new key for you and return it.
    #
    # Parameters:
    # * username (String) = Your Mailchimp account username.
    # * password (String) = Your Mailchimp account password.
    #
    # Returns:
    # A new API Key that can be immediately used.
    #
    def add_api_key(username, password)
      @chimpApi.call("apikeyAdd", username, password, @config[:api_key])
    end
    
    # Retrieve a list of all MailChimp API Keys for this User.
    #
    # Parameters:
    # * username (String)   = Your Mailchimp account username.
    # * password (String)   = Your Mailchimp account password.
    # * expired  (Boolean)  = Whether or not to include expired keys, defaults to false.
    #
    # Returns:
    # An array of API keys including:
    # * apikey      (String) = The api key that can be used.
    # * created_at  (String) = The date the key was created.
    # * expired_at  (String) = The date the key was expired.
    #
    def api_keys(username, password, expired = false)
      @chimpApi.call("apikeys", username, password, @config[:api_key], expired)
    end
    
    # Expire a Specific API Key.
    #
    # Returns:
    # True if successful, error code if not.
    #
    def expire_api_key(username, password)
      @chimpApi.call("apikeyExpire", username, password, @config[:api_key])
    end
    
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
hominid-2.2.0 lib/hominid/security.rb
hominid-2.1.10 lib/hominid/security.rb
hominid-2.1.9 lib/hominid/security.rb
hominid-2.1.7 lib/hominid/security.rb
hominid-2.1.6 lib/hominid/security.rb
hominid-2.1.5 lib/hominid/security.rb
hominid-2.1.2 lib/hominid/security.rb
hominid-2.1.1 lib/hominid/security.rb
hominid-2.1.0 lib/hominid/security.rb
hominid-2.0.4 lib/hominid/security.rb
hominid-2.0.3 lib/hominid/security.rb