Sha256: b0620bc5eb4fe5f3563811377ee05d7a378397d27f28a192d5bbf38572de77ee

Contents?: true

Size: 1.61 KB

Versions: 15

Compression:

Stored size: 1.61 KB

Contents

module Lumberg
  module Cpanel
    # Public: Allows users to specify contact information and preferences
    class Contact < Base
      def self.api_module; "CustInfo"; end

      # Public: Show your contact information and email notfication settings
      #
      # Returns Hash API response
      def show
        perform_request({ api_function: 'displaycontactinfo' })
      end

      # Public: Updates the user's contact info and settings for email
      # notifications
      #
      # options - Hash options for API call params (default: {})
      #   :email - String email account to send notifications to
      #   :second_email - String secondary email account to send notifications
      #                   to (default: String)
      #   :email_quota - Boolean value. Set to true to be notified when you are
      #                  when one of your email accounts approaches or is over
      #                  quota (default: Boolean)
      #   :disk_quota - Boolean value. Set to true to be notified when you are
      #                 when you are reaching your disk quota (default: Boolean)
      #   :bandwidth - Boolean value. Set to true to be notified when you are
      #                reaching your bandwidth usage limit (default: Boolean)
      #
      # Returns Hash API response
      def update(options = {})
        options[:notify_disk_limit] = options.delete(:disk_quota)
        options[:notify_bandwidth_limit] = options.delete(:bandwidth)
        options[:notify_email_quota_limit] = options.delete(:email_quota)
        perform_request({ api_function: 'savecontactinfo' }.merge(options))
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
lumberg-4.1.0 lib/lumberg/cpanel/contact.rb
lumberg-4.0.0 lib/lumberg/cpanel/contact.rb
lumberg-3.1.0 lib/lumberg/cpanel/contact.rb
lumberg-3.0.0 lib/lumberg/cpanel/contact.rb
lumberg-2.0.1 lib/lumberg/cpanel/contact.rb
lumberg-2.0.0 lib/lumberg/cpanel/contact.rb
lumberg-2.0.0.pre20 lib/lumberg/cpanel/contact.rb
lumberg-2.0.0.pre18 lib/lumberg/cpanel/contact.rb
lumberg-2.0.0.pre15 lib/lumberg/cpanel/contact.rb
lumberg-2.0.0.pre12 lib/lumberg/cpanel/contact.rb
lumberg-2.0.0.pre9 lib/lumberg/cpanel/contact.rb
lumberg-2.0.0.pre8 lib/lumberg/cpanel/contact.rb
lumberg-2.0.0.pre7 lib/lumberg/cpanel/contact.rb
lumberg-2.0.0.pre6 lib/lumberg/cpanel/contact.rb
lumberg-2.0.0.pre5 lib/lumberg/cpanel/contact.rb