Sha256: d63a2d336bbae29d6a027f67fbfeec4ae7d49156ff5186db6e6a7f66efc0b0a7

Contents?: true

Size: 1.28 KB

Versions: 7

Compression:

Stored size: 1.28 KB

Contents

#
# account_service.rb
# ConstantContact
#
# Copyright (c) 2013 Constant Contact. All rights reserved.

module ConstantContact
  module Services
    class AccountService < BaseService
      class << self

        # Get a summary of account information
        # @return [AccountInfo]
        def get_account_info()
          url = Util::Config.get('endpoints.base_url') + Util::Config.get('endpoints.account_info')
          url = build_url(url)
          response = RestClient.get(url, get_headers())
          Components::AccountInfo.create(JSON.parse(response.body))
        end


        # Get all verified email addresses associated with an account
        # @param [Hash] params - hash of query parameters/values to append to the request
        # @return [Array<VerifiedEmailAddress>]
        def get_verified_email_addresses(params)
          url = Util::Config.get('endpoints.base_url') + Util::Config.get('endpoints.account_verified_addresses')
          url = build_url(url, params)
          response = RestClient.get(url, get_headers())
          email_addresses = []
          JSON.parse(response.body).each do |email_address|
            email_addresses << Components::VerifiedEmailAddress.create(email_address)
          end
          email_addresses
        end

      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
constantcontact-2.2.1 lib/constantcontact/services/account_service.rb
constantcontact-ruby-2.2.1 lib/constantcontact/services/account_service.rb
constantcontact-ruby-2.2.0 lib/constantcontact/services/account_service.rb
constantcontact-2.2.0 lib/constantcontact/services/account_service.rb
constantcontact-2.1.0 lib/constantcontact/services/account_service.rb
constantcontact-2.0.1 lib/constantcontact/services/account_service.rb
constantcontact-2.0.0 lib/constantcontact/services/account_service.rb