def create_complaints(data)
      # `data` should be a list of hashes, with each hash containing *at least* an `address` key.
      split_return = []
      if data.length >= 1000 then
        resp, resp_l = create_complaints data[999..-1]
        split_return.push(resp)
        split_return.concat(resp_l)
        data = data[0..998]
      elsif data.length == 0 then
        return nil, []
      end

      valid = []
      # Validate the complaints given
      while not data.empty? do
        complaint = data.pop
        # complaints MUST contain a `address` key.
        if not complaint.include? :address then
          raise Mailgun::ParameterError.new "Complaint MUST include a :address key: #{complaint}"
        end

        complaint.each do |k, v|
          # Hash values MUST be strings.
          if not v.is_a? String then
            complaint[k] = v.to_s
          end
        end

        valid.push complaint
      end

      response = @client.post("#{@domain}/complaints", valid.to_json, { "Content-Type" => "application/json" })
      return response, split_return
    end
def create_complaints(data)
      # `data` should be a list of hashes, with each hash containing *at least* an `address` key.
      split_return = []
      if data.length >= 1000 then
        resp, resp_l = create_complaints data[999..-1]
        split_return.push(resp)
        split_return.concat(resp_l)
        data = data[0..998]
      elsif data.length == 0 then
        return nil, []
      end

      valid = []
      # Validate the complaints given
      while not data.empty? do
        complaint = data.pop
        # complaints MUST contain a `address` key.
        if not complaint.include? :address then
          raise Mailgun::ParameterError.new "Complaint MUST include a :address key: #{complaint}"
        end

        complaint.each do |k, v|
          # Hash values MUST be strings.
          if not v.is_a? String then
            complaint[k] = v.to_s
          end
        end

        valid.push complaint
      end

      response = @client.post("#{@domain}/complaints", valid.to_json, { "Content-Type" => "application/json" })
      return response, split_return
    end
Creates multiple complaints on the Mailgun API.
 If a complaint does not have a valid structure, it will be added to a list of unsendable complaints.
 The list of unsendable complaints will be returned at the end of this operation.

 If more than 999 complaint entries are provided, the list will be split and recursive calls will be made.

 @param [Array] data Array of complaint hashes
 @return [Response] Mailgun API response
 @return [Array] Return values from recursive call for list split.